home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1995-08-13 | 16.4 KB | [ TEXT/CWIE]
open in: MacOS 8.1
extracted
|
Win98
extracted
|
DOS
extracted
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary ).
You can browse this item here: VBLInstall.c
Confidence Program Detection Match Type Support
66%
dexvert
Compact Compressed (Unix) (archive/compact)
ext
Supported
10%
dexvert
MacBinary (archive/macBinary)
fallback
Supported
1%
dexvert
Text File (text/txt)
fallback
Supported
100%
file
MacBinary II, inited, Sun Aug 13 19:52:47 1995, modified Sun Aug 13 19:52:47 1995, creator 'CWIE', type ASCII, 15676 bytes "VBLInstall.c" , at 0x3dbc 852 bytes resource
default (weak)
99%
file
data
default
74%
TrID
Macintosh plain text (MacBinary)
default
25%
TrID
MacBinary 2
default (weak)
100%
siegfried
fmt/1762 MacBinary (II)
default
100%
lsar
MacBinary
default
id metadata key value macFileType [ TEXT] macFileCreator [ CWIE]
hex view +--------+-------------------------+-------------------------+--------+--------+ |00000000| 00 0c 56 42 4c 49 6e 73 | 74 61 6c 6c 2e 63 00 00 |..VBLIns|tall.c..| |00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......| |00000050| 00 00 00 00 00 3d 3c 00 | 00 03 54 ac 54 40 cf ac |.....=<.|..T.T@..| |00000060| 54 40 cf 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |T@......|........| |00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 6c f6 00 00 |........|....l...| |00000080| 2f 2a 0d 56 42 4c 49 6e | 73 74 61 6c 6c 2e 63 0d |/*.VBLIn|stall.c.| |00000090| 0d 54 68 69 73 20 69 73 | 20 74 68 65 20 41 70 70 |.This is| the App| |000000a0| 6c 65 2d 72 65 63 6f 6d | 6d 65 6e 64 65 64 20 77 |le-recom|mended w| |000000b0| 61 79 20 6f 66 20 73 79 | 6e 63 68 72 6f 6e 69 7a |ay of sy|nchroniz| |000000c0| 69 6e 67 20 79 6f 75 72 | 20 70 72 6f 67 72 61 6d |ing your| program| |000000d0| 20 74 6f 20 61 20 76 69 | 64 65 6f 0d 64 69 73 70 | to a vi|deo.disp| |000000e0| 6c 61 79 2e 20 49 6e 20 | 74 68 65 20 4d 61 63 69 |lay. In |the Maci| |000000f0| 6e 74 6f 73 68 2c 20 69 | 6e 74 65 72 72 75 70 74 |ntosh, i|nterrupt| |00000100| 20 73 65 72 76 69 63 65 | 20 72 6f 75 74 69 6e 65 | service| routine| |00000110| 73 20 72 75 6e 20 61 74 | 20 61 20 68 69 67 68 20 |s run at| a high | |00000120| 70 72 6f 63 65 73 73 6f | 72 0d 70 72 69 6f 72 69 |processo|r.priori| |00000130| 74 79 2c 20 69 2e 65 2e | 20 74 68 65 79 20 62 6c |ty, i.e.| they bl| |00000140| 6f 63 6b 20 69 6e 74 65 | 72 72 75 70 74 73 20 77 |ock inte|rrupts w| |00000150| 68 69 6c 65 20 74 68 65 | 79 20 72 75 6e 2c 20 73 |hile the|y run, s| |00000160| 6f 20 41 70 70 6c 65 20 | 61 64 76 69 73 65 73 20 |o Apple |advises | |00000170| 74 68 61 74 20 74 68 65 | 79 0d 62 65 20 76 65 72 |that the|y.be ver| |00000180| 79 20 71 75 69 63 6b 2c | 20 74 6f 20 61 76 6f 69 |y quick,| to avoi| |00000190| 64 20 6d 69 73 73 69 6e | 67 20 69 6e 74 65 72 72 |d missin|g interr| |000001a0| 75 70 74 73 2e 20 54 68 | 61 74 20 69 73 20 74 68 |upts. Th|at is th| |000001b0| 65 20 61 70 70 72 6f 61 | 63 68 20 74 61 6b 65 6e |e approa|ch taken| |000001c0| 20 68 65 72 65 2c 0d 75 | 73 69 6e 67 20 74 68 65 | here,.u|sing the| |000001d0| 20 69 6e 74 65 72 72 75 | 70 74 20 73 65 72 76 69 | interru|pt servi| |000001e0| 63 65 20 72 6f 75 74 69 | 6e 65 73 20 73 6f 6c 65 |ce routi|nes sole| |000001f0| 6c 79 20 74 6f 20 62 75 | 6d 70 20 61 20 66 72 61 |ly to bu|mp a fra| |00000200| 6d 65 20 63 6f 75 6e 74 | 65 72 20 61 6e 64 20 73 |me count|er and s| |00000210| 65 74 20 61 0d 6e 65 77 | 46 72 61 6d 65 20 66 6c |et a.new|Frame fl| |00000220| 61 67 20 74 6f 20 74 72 | 75 65 2e 20 54 79 70 69 |ag to tr|ue. Typi| |00000230| 63 61 6c 6c 79 20 79 6f | 75 72 20 6d 61 69 6e 20 |cally yo|ur main | |00000240| 70 72 6f 67 72 61 6d 20 | 77 69 6c 6c 20 69 74 65 |program |will ite| |00000250| 72 61 74 69 76 65 6c 79 | 20 74 65 73 74 20 74 68 |ratively| test th| |00000260| 65 0d 6e 65 77 46 72 61 | 6d 65 20 66 6c 61 67 20 |e.newFra|me flag | |00000270| 61 6e 64 2c 20 77 68 65 | 6e 20 69 74 27 73 20 74 |and, whe|n it's t| |00000280| 72 75 65 2c 20 63 6c 65 | 61 72 20 69 74 20 61 6e |rue, cle|ar it an| |00000290| 64 20 64 6f 20 73 6f 6d | 65 20 61 63 74 69 6f 6e |d do som|e action| |000002a0| 20 74 68 61 74 20 79 6f | 75 20 77 61 6e 74 20 74 | that yo|u want t| |000002b0| 6f 0d 64 6f 20 6f 6e 63 | 65 20 70 65 72 20 66 72 |o.do onc|e per fr| |000002c0| 61 6d 65 2c 20 69 6e 20 | 73 79 6e 63 68 20 77 69 |ame, in |synch wi| |000002d0| 74 68 20 74 68 65 20 76 | 69 64 65 6f 20 66 72 61 |th the v|ideo fra| |000002e0| 6d 65 73 2e 0d 0d 4f 53 | 45 72 72 20 56 42 4c 49 |mes...OS|Err VBLI| |000002f0| 6e 73 74 61 6c 6c 28 56 | 42 4c 54 61 73 6b 41 6e |nstall(V|BLTaskAn| |00000300| 64 41 35 20 2a 76 62 6c | 44 61 74 61 2c 47 44 48 |dA5 *vbl|Data,GDH| |00000310| 61 6e 64 6c 65 20 64 65 | 76 69 63 65 2c 69 6e 74 |andle de|vice,int| |00000320| 20 66 72 61 6d 65 73 29 | 3b 0d 0d 54 68 65 20 66 | frames)|;..The f| |00000330| 69 72 73 74 20 61 72 67 | 75 6d 65 6e 74 20 69 73 |irst arg|ument is| |00000340| 20 61 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 61 20 | a point|er to a | |00000350| 75 73 65 72 2d 73 75 70 | 70 6c 69 65 64 20 64 61 |user-sup|plied da| |00000360| 74 61 20 73 74 72 75 63 | 74 75 72 65 2e 20 22 64 |ta struc|ture. "d| |00000370| 65 76 69 63 65 22 20 69 | 73 20 61 0d 68 61 6e 64 |evice" i|s a.hand| |00000380| 6c 65 20 74 6f 20 74 68 | 65 20 76 69 64 65 6f 20 |le to th|e video | |00000390| 73 63 72 65 65 6e 20 74 | 68 61 74 20 79 6f 75 20 |screen t|hat you | |000003a0| 77 61 6e 74 20 74 6f 20 | 73 79 6e 63 68 72 6f 6e |want to |synchron| |000003b0| 69 7a 65 20 74 6f 2c 20 | 6f 72 20 4e 55 4c 4c 20 |ize to, |or NULL | |000003c0| 69 66 20 79 6f 75 20 77 | 61 6e 74 0d 74 6f 20 73 |if you w|ant.to s| |000003d0| 79 6e 63 68 72 6f 6e 69 | 7a 65 20 74 6f 20 74 68 |ynchroni|ze to th| |000003e0| 65 20 53 79 73 74 65 6d | 20 56 42 4c 20 72 61 74 |e System| VBL rat| |000003f0| 65 20 28 75 73 75 61 6c | 6c 79 20 36 30 2e 31 35 |e (usual|ly 60.15| |00000400| 20 48 7a 29 2e 20 54 68 | 65 20 6c 61 73 74 20 61 | Hz). Th|e last a| |00000410| 72 67 75 6d 65 6e 74 2c | 0d 22 66 72 61 6d 65 73 |rgument,|."frames| |00000420| 22 2c 20 73 70 65 63 69 | 66 69 65 73 20 68 6f 77 |", speci|fies how| |00000430| 20 6d 61 6e 79 20 74 69 | 6d 65 73 20 79 6f 75 20 | many ti|mes you | |00000440| 77 61 6e 74 20 74 68 65 | 20 69 6e 74 65 72 72 75 |want the| interru| |00000450| 70 74 20 74 6f 20 6f 63 | 63 75 72 20 62 65 66 6f |pt to oc|cur befo| |00000460| 72 65 20 74 68 65 0d 72 | 6f 75 74 69 6e 65 20 64 |re the.r|outine d| |00000470| 69 73 61 62 6c 65 73 20 | 69 74 73 65 6c 66 2e 20 |isables |itself. | |00000480| 49 66 20 66 72 61 6d 65 | 73 3c 30 20 74 68 65 6e |If frame|s<0 then| |00000490| 20 74 68 65 20 69 6e 74 | 65 72 72 75 70 74 20 77 | the int|errupt w| |000004a0| 69 6c 6c 20 72 65 63 75 | 72 20 69 6e 64 65 66 69 |ill recu|r indefi| |000004b0| 6e 69 74 65 6c 79 2e 0d | 0d 56 42 4c 49 6e 73 74 |nitely..|.VBLInst| |000004c0| 61 6c 6c 20 7a 65 72 6f | 65 73 20 76 62 6c 44 61 |all zero|es vblDa| |000004d0| 74 61 2d 3e 66 72 61 6d | 65 2c 20 61 6e 64 20 73 |ta->fram|e, and s| |000004e0| 65 74 73 20 76 62 6c 44 | 61 74 61 2d 3e 66 72 61 |ets vblD|ata->fra| |000004f0| 6d 65 73 44 65 73 69 72 | 65 64 20 61 6e 64 20 0d |mesDesir|ed and .| |00000500| 76 62 6c 44 61 74 61 2d | 3e 66 72 61 6d 65 73 4c |vblData-|>framesL| |00000510| 65 66 74 20 65 71 75 61 | 6c 20 74 6f 0d 22 66 72 |eft equa|l to."fr| |00000520| 61 6d 65 73 22 2e 20 57 | 68 69 6c 65 20 76 62 6c |ames". W|hile vbl| |00000530| 44 61 74 61 2d 3e 66 72 | 61 6d 65 73 4c 65 66 74 |Data->fr|amesLeft| |00000540| 21 3d 30 2c 20 61 74 20 | 65 61 63 68 20 65 6e 64 |!=0, at |each end| |00000550| 2d 6f 66 2d 66 72 61 6d | 65 20 69 6e 74 65 72 72 |-of-fram|e interr| |00000560| 75 70 74 0d 76 62 6c 44 | 61 74 61 2d 3e 66 72 61 |upt.vblD|ata->fra| |00000570| 6d 65 20 77 69 6c 6c 20 | 62 65 20 69 6e 63 72 65 |me will |be incre| |00000580| 6d 65 6e 74 65 64 20 61 | 6e 64 20 76 62 6c 44 61 |mented a|nd vblDa| |00000590| 74 61 2d 3e 6e 65 77 46 | 72 61 6d 65 20 77 69 6c |ta->newF|rame wil| |000005a0| 6c 20 62 65 20 73 65 74 | 20 74 6f 20 31 2e 20 0d |l be set| to 1. .| |000005b0| 76 62 6c 44 61 74 61 2d | 3e 66 72 61 6d 65 73 4c |vblData-|>framesL| |000005c0| 65 66 74 20 77 69 6c 6c | 20 62 65 20 64 65 63 72 |eft will| be decr| |000005d0| 65 6d 65 6e 74 65 64 20 | 69 66 0d 69 74 27 73 20 |emented |if.it's | |000005e0| 3e 30 2c 20 62 75 74 20 | 6c 65 66 74 20 61 6c 6f |>0, but |left alo| |000005f0| 6e 65 20 69 66 20 69 74 | 27 73 20 6e 65 67 61 74 |ne if it|'s negat| |00000600| 69 76 65 2e 20 49 66 20 | 76 62 6c 44 61 74 61 2d |ive. If |vblData-| |00000610| 3e 66 72 61 6d 65 73 4c | 65 66 74 20 69 73 20 64 |>framesL|eft is d| |00000620| 65 63 72 65 6d 65 6e 74 | 65 64 0d 74 6f 20 7a 65 |ecrement|ed.to ze| |00000630| 72 6f 20 74 68 65 6e 20 | 74 68 65 20 69 6e 74 65 |ro then |the inte| |00000640| 72 72 75 70 74 20 73 65 | 72 76 69 63 65 20 72 6f |rrupt se|rvice ro| |00000650| 75 74 69 6e 65 20 69 73 | 20 64 6f 6e 65 2c 20 61 |utine is| done, a| |00000660| 6e 64 20 77 6f 6e 27 74 | 20 72 65 65 6e 61 62 6c |nd won't| reenabl| |00000670| 65 20 74 68 65 0d 69 6e | 74 65 72 72 75 70 74 2e |e the.in|terrupt.| |00000680| 0d 0d 48 65 72 65 27 73 | 20 61 20 6d 69 6e 69 6d |..Here's| a minim| |00000690| 61 6c 20 70 72 6f 67 72 | 61 6d 2c 20 65 78 74 72 |al progr|am, extr| |000006a0| 61 63 74 65 64 20 66 72 | 6f 6d 20 4e 6f 69 73 65 |acted fr|om Noise| |000006b0| 56 42 4c 2e 63 2c 20 74 | 68 61 74 20 75 73 65 73 |VBL.c, t|hat uses| |000006c0| 20 74 68 65 73 65 20 72 | 6f 75 74 69 6e 65 73 20 | these r|outines | |000006d0| 74 6f 0d 73 68 6f 77 20 | 61 20 31 30 30 2d 66 72 |to.show |a 100-fr| |000006e0| 61 6d 65 20 6d 6f 76 69 | 65 2c 20 77 69 74 68 20 |ame movi|e, with | |000006f0| 61 20 6e 65 77 20 69 6d | 61 67 65 20 6f 6e 20 65 |a new im|age on e| |00000700| 61 63 68 20 76 69 64 65 | 6f 20 66 72 61 6d 65 3a |ach vide|o frame:| |00000710| 0d 0d 09 56 42 4c 54 61 | 73 6b 41 6e 64 41 35 20 |...VBLTa|skAndA5 | |00000720| 6e 6f 69 73 65 56 42 4c | 3b 0d 09 47 44 48 61 6e |noiseVBL|;..GDHan| |00000730| 64 6c 65 20 64 65 76 69 | 63 65 3d 47 65 74 4d 61 |dle devi|ce=GetMa| |00000740| 69 6e 44 65 76 69 63 65 | 28 29 3b 0d 09 69 6e 74 |inDevice|();..int| |00000750| 20 66 72 61 6d 65 73 3d | 31 30 30 2c 65 72 72 6f | frames=|100,erro| |00000760| 72 3b 0d 0d 09 6e 6f 69 | 73 65 56 42 4c 2e 73 75 |r;...noi|seVBL.su| |00000770| 62 72 6f 75 74 69 6e 65 | 3d 4e 55 4c 4c 3b 09 09 |broutine|=NULL;..| |00000780| 09 09 2f 2f 20 72 65 71 | 75 65 73 74 20 64 65 66 |..// req|uest def| |00000790| 61 75 6c 74 20 73 75 62 | 72 6f 75 74 69 6e 65 0d |ault sub|routine.| |000007a0| 09 65 72 72 6f 72 3d 56 | 42 4c 49 6e 73 74 61 6c |.error=V|BLInstal| |000007b0| 6c 28 26 6e 6f 69 73 65 | 56 42 4c 2c 64 65 76 69 |l(&noise|VBL,devi| |000007c0| 63 65 2c 66 72 61 6d 65 | 73 29 3b 0d 09 69 66 28 |ce,frame|s);..if(| |000007d0| 65 72 72 6f 72 29 50 72 | 69 6e 74 66 45 78 69 74 |error)Pr|intfExit| |000007e0| 28 22 56 42 4c 49 6e 73 | 74 61 6c 6c 20 65 72 72 |("VBLIns|tall err| |000007f0| 6f 72 20 25 64 5c 6e 22 | 2c 65 72 72 6f 72 29 3b |or %d\n"|,error);| |00000800| 0d 09 6e 6f 69 73 65 56 | 42 4c 2e 76 62 6c 2e 76 |..noiseV|BL.vbl.v| |00000810| 62 6c 43 6f 75 6e 74 3d | 31 3b 09 2f 2f 20 65 6e |blCount=|1;.// en| |00000820| 61 62 6c 65 20 74 68 65 | 20 69 6e 74 65 72 72 75 |able the| interru| |00000830| 70 74 20 73 65 72 76 69 | 63 65 20 72 6f 75 74 69 |pt servi|ce routi| |00000840| 6e 65 0d 09 77 68 69 6c | 65 28 6e 6f 69 73 65 56 |ne..whil|e(noiseV| |00000850| 42 4c 2e 66 72 61 6d 65 | 73 4c 65 66 74 29 7b 0d |BL.frame|sLeft){.| |00000860| 09 09 69 66 28 6e 6f 69 | 73 65 56 42 4c 2e 6e 65 |..if(noi|seVBL.ne| |00000870| 77 46 72 61 6d 65 29 7b | 0d 09 09 09 6e 6f 69 73 |wFrame){|....nois| |00000880| 65 56 42 4c 2e 6e 65 77 | 46 72 61 6d 65 3d 30 3b |eVBL.new|Frame=0;| |00000890| 0d 09 09 09 43 6f 70 79 | 42 69 74 73 51 75 69 63 |....Copy|BitsQuic| |000008a0| 6b 6c 79 28 28 42 69 74 | 4d 61 70 20 2a 29 26 28 |kly((Bit|Map *)&(| |000008b0| 6d 6f 76 69 65 5b 6e 6f | 69 73 65 56 42 4c 2e 66 |movie[no|iseVBL.f| |000008c0| 72 61 6d 65 5d 29 0d 09 | 09 09 09 2c 28 42 69 74 |rame])..|...,(Bit| |000008d0| 4d 61 70 20 2a 29 2a 28 | 28 43 47 72 61 66 50 74 |Map *)*(|(CGrafPt| |000008e0| 72 29 77 69 6e 64 6f 77 | 29 2d 3e 70 6f 72 74 50 |r)window|)->portP| |000008f0| 69 78 4d 61 70 0d 09 09 | 09 09 2c 26 6e 6f 69 73 |ixMap...|..,&nois| |00000900| 65 49 6d 61 67 65 5b 30 | 5d 2e 62 6f 75 6e 64 73 |eImage[0|].bounds| |00000910| 2c 26 77 69 6e 64 6f 77 | 2d 3e 70 6f 72 74 52 65 |,&window|->portRe| |00000920| 63 74 2c 73 72 63 43 6f | 70 79 2c 4e 55 4c 4c 29 |ct,srcCo|py,NULL)| |00000930| 3b 0d 09 09 7d 0d 09 7d | 0d 09 56 42 4c 52 65 6d |;...}..}|..VBLRem| |00000940| 6f 76 65 28 26 6e 6f 69 | 73 65 56 42 4c 29 3b 0d |ove(&noi|seVBL);.| |00000950| 0d 41 70 70 6c 65 20 77 | 61 72 6e 73 20 74 68 61 |.Apple w|arns tha| |00000960| 74 20 69 6e 74 65 72 72 | 75 70 74 20 73 65 72 76 |t interr|upt serv| |00000970| 69 63 65 20 72 6f 75 74 | 69 6e 65 73 20 61 6e 64 |ice rout|ines and| |00000980| 20 61 6e 79 20 64 61 74 | 61 20 74 68 61 74 20 74 | any dat|a that t| |00000990| 68 65 79 20 61 63 63 65 | 73 73 20 6d 75 73 74 0d |hey acce|ss must.| |000009a0| 62 65 20 6c 6f 63 6b 65 | 64 20 69 6e 74 6f 20 6d |be locke|d into m| |000009b0| 65 6d 6f 72 79 2c 20 6e | 6f 74 20 73 77 61 70 70 |emory, n|ot swapp| |000009c0| 65 64 20 6f 75 74 2c 20 | 65 2e 67 2e 20 64 75 65 |ed out, |e.g. due| |000009d0| 20 74 6f 20 6f 70 65 72 | 61 74 69 6f 6e 20 6f 66 | to oper|ation of| |000009e0| 20 74 68 65 20 4d 65 6d | 6f 72 79 0d 4d 61 6e 61 | the Mem|ory.Mana| |000009f0| 67 65 72 20 6f 72 20 56 | 69 72 74 75 61 6c 20 4d |ger or V|irtual M| |00000a00| 65 6d 6f 72 79 2e 20 49 | 74 20 69 73 20 64 61 6e |emory. I|t is dan| |00000a10| 67 65 72 6f 75 73 20 74 | 6f 20 61 6c 6c 6f 77 20 |gerous t|o allow | |00000a20| 79 6f 75 72 20 63 6f 6d | 70 69 6c 65 72 20 74 6f |your com|piler to| |00000a30| 20 69 6e 73 74 61 6c 6c | 0d 64 65 62 75 67 67 69 | install|.debuggi| |00000a40| 6e 67 20 63 6f 64 65 20 | 69 6e 74 6f 20 69 6e 74 |ng code |into int| |00000a50| 65 72 72 75 70 74 20 73 | 65 72 76 69 63 65 20 72 |errupt s|ervice r| |00000a60| 6f 75 74 69 6e 65 73 2e | 20 49 74 20 69 73 20 56 |outines.| It is V| |00000a70| 45 52 59 20 69 6d 70 6f | 72 74 61 6e 74 20 74 68 |ERY impo|rtant th| |00000a80| 61 74 20 79 6f 75 0d 63 | 61 6c 6c 20 56 42 4c 52 |at you.c|all VBLR| |00000a90| 65 6d 6f 76 65 28 29 20 | 62 65 66 6f 72 65 20 71 |emove() |before q| |00000aa0| 75 69 74 74 69 6e 67 2e | 20 4f 6e 63 65 20 69 6e |uitting.| Once in| |00000ab0| 73 74 61 6c 6c 65 64 2c | 20 73 6c 6f 74 2d 62 61 |stalled,| slot-ba| |00000ac0| 73 65 64 20 69 6e 74 65 | 72 72 75 70 74 20 74 61 |sed inte|rrupt ta| |00000ad0| 73 6b 73 0d 6b 65 65 70 | 20 67 6f 69 6e 67 20 66 |sks.keep| going f| |00000ae0| 6f 72 65 76 65 72 2e 20 | 28 54 75 72 6e 69 6e 67 |orever. |(Turning| |00000af0| 20 6f 66 66 20 76 62 6c | 44 61 74 61 2d 3e 76 62 | off vbl|Data->vb| |00000b00| 6c 2e 76 62 6c 43 6f 75 | 6e 74 20 64 69 73 61 62 |l.vblCou|nt disab| |00000b10| 6c 65 73 20 74 68 65 20 | 72 6f 75 74 69 6e 65 2c |les the |routine,| |00000b20| 20 62 75 74 0d 64 6f 65 | 73 6e 27 74 20 72 65 6d | but.doe|sn't rem| |00000b30| 6f 76 65 20 69 74 2e 29 | 20 54 68 65 20 74 61 73 |ove it.)| The tas| |00000b40| 6b 73 20 61 72 65 20 6e | 6f 74 20 72 65 6d 6f 76 |ks are n|ot remov| |00000b50| 65 64 20 62 79 20 74 68 | 65 20 46 69 6e 64 65 72 |ed by th|e Finder| |00000b60| 20 6f 72 20 53 79 73 74 | 65 6d 20 77 68 65 6e 20 | or Syst|em when | |00000b70| 79 6f 75 72 0d 61 70 70 | 6c 69 63 61 74 69 6f 6e |your.app|lication| |00000b80| 20 66 69 6e 69 73 68 65 | 73 2c 20 65 76 65 6e 20 | finishe|s, even | |00000b90| 74 68 6f 75 67 68 20 74 | 68 65 20 69 6e 74 65 72 |though t|he inter| |00000ba0| 72 75 70 74 20 73 65 72 | 76 69 63 65 20 72 6f 75 |rupt ser|vice rou| |00000bb0| 74 69 6e 65 27 73 20 63 | 6f 64 65 20 61 6e 64 20 |tine's c|ode and | |00000bc0| 64 61 74 61 0d 77 69 6c | 6c 20 70 72 6f 62 61 62 |data.wil|l probab| |00000bd0| 6c 79 20 62 65 20 6f 76 | 65 72 77 72 69 74 74 65 |ly be ov|erwritte| |00000be0| 6e 2e 0d 0d 41 63 74 75 | 61 6c 6c 79 2c 20 74 68 |n...Actu|ally, th| |00000bf0| 69 6e 67 73 20 61 72 65 | 6e 27 74 20 74 68 61 74 |ings are|n't that| |00000c00| 20 62 61 64 2c 20 62 65 | 63 61 75 73 65 20 49 27 | bad, be|cause I'| |00000c10| 76 65 20 61 64 64 65 64 | 20 61 20 63 61 6c 6c 20 |ve added| a call | |00000c20| 74 6f 20 5f 61 74 65 78 | 69 74 28 29 0d 72 65 71 |to _atex|it().req| |00000c30| 75 65 73 74 69 6e 67 20 | 74 68 61 74 20 61 6c 6c |uesting |that all| |00000c40| 20 74 68 65 20 56 42 4c | 20 74 61 73 6b 73 20 69 | the VBL| tasks i| |00000c50| 6e 73 74 61 6c 6c 65 64 | 20 62 79 20 56 42 4c 49 |nstalled| by VBLI| |00000c60| 6e 73 74 61 6c 6c 28 29 | 20 62 65 20 72 65 6d 6f |nstall()| be remo| |00000c70| 76 65 64 20 77 68 65 6e | 65 76 65 72 0d 74 68 65 |ved when|ever.the| |00000c80| 20 70 72 6f 67 72 61 6d | 20 74 65 72 6d 69 6e 61 | program| termina| |00000c90| 74 65 73 2c 20 77 68 65 | 74 68 65 72 20 6e 6f 72 |tes, whe|ther nor| |00000ca0| 6d 61 6c 6c 79 20 6f 72 | 20 61 62 6e 6f 72 6d 61 |mally or| abnorma| |00000cb0| 6c 6c 79 2e 20 54 68 69 | 73 20 70 72 65 76 65 6e |lly. Thi|s preven| |00000cc0| 74 73 20 74 68 65 0d 6f | 74 68 65 72 77 69 73 65 |ts the.o|therwise| |00000cd0| 20 76 65 72 79 20 61 6e | 6e 6f 79 69 6e 67 20 63 | very an|noying c| |00000ce0| 72 61 73 68 20 74 68 61 | 74 20 77 6f 75 6c 64 20 |rash tha|t would | |00000cf0| 61 63 63 6f 6d 70 61 6e | 79 20 70 72 65 6d 61 74 |accompan|y premat| |00000d00| 75 72 65 20 74 65 72 6d | 69 6e 61 74 69 6f 6e 2c |ure term|ination,| |00000d10| 20 65 2e 67 2e 0d 62 79 | 20 74 79 70 69 6e 67 20 | e.g..by| typing | |00000d20| 63 6f 6d 6d 61 6e 64 2d | 2e 2c 20 77 68 69 6c 65 |command-|., while| |00000d30| 20 74 68 65 20 56 42 4c | 20 74 61 73 6b 20 69 73 | the VBL| task is| |00000d40| 20 61 63 74 69 76 65 2e | 0d 0d 57 72 69 74 69 6e | active.|..Writin| |00000d50| 67 20 61 6e 20 69 6e 74 | 65 72 72 75 70 74 20 73 |g an int|errupt s| |00000d60| 65 72 76 69 63 65 20 72 | 6f 75 74 69 6e 65 2c 20 |ervice r|outine, | |00000d70| 74 6f 20 62 65 20 63 61 | 6c 6c 65 64 20 6f 6e 63 |to be ca|lled onc| |00000d80| 65 20 70 65 72 20 76 69 | 64 65 6f 20 66 72 61 6d |e per vi|deo fram| |00000d90| 65 2c 20 69 73 0d 73 6c | 69 67 68 74 6c 79 20 74 |e, is.sl|ightly t| |00000da0| 72 69 63 6b 79 2e 20 56 | 42 4c 49 6e 74 65 72 72 |ricky. V|BLInterr| |00000db0| 75 70 74 53 65 72 76 69 | 63 65 52 6f 75 74 69 6e |uptServi|ceRoutin| |00000dc0| 65 20 64 6f 65 73 20 61 | 6c 6c 20 74 68 65 20 64 |e does a|ll the d| |00000dd0| 69 72 74 79 20 77 6f 72 | 6b 2c 20 61 6e 64 20 74 |irty wor|k, and t| |00000de0| 68 65 6e 0d 63 61 6c 6c | 73 20 61 20 75 73 65 72 |hen.call|s a user| |00000df0| 2d 73 75 70 70 6c 69 65 | 64 20 73 75 62 72 6f 75 |-supplie|d subrou| |00000e00| 74 69 6e 65 20 74 68 61 | 74 20 64 6f 65 73 20 77 |tine tha|t does w| |00000e10| 68 61 74 65 76 65 72 20 | 79 6f 75 20 77 61 6e 74 |hatever |you want| |00000e20| 2e 20 49 66 20 61 6c 6c | 20 79 6f 75 20 77 61 6e |. If all| you wan| |00000e30| 74 20 74 6f 0d 64 6f 20 | 69 73 20 61 64 76 61 6e |t to.do |is advan| |00000e40| 63 65 20 61 20 66 72 61 | 6d 65 20 63 6f 75 6e 74 |ce a fra|me count| |00000e50| 65 72 20 75 6e 74 69 6c | 20 79 6f 75 20 72 65 61 |er until| you rea| |00000e60| 63 68 20 74 68 65 20 64 | 65 73 69 72 65 64 20 6e |ch the d|esired n| |00000e70| 75 6d 62 65 72 20 6f 66 | 20 66 72 61 6d 65 73 20 |umber of| frames | |00000e80| 74 68 65 6e 0d 79 6f 75 | 20 6d 61 79 20 77 69 73 |then.you| may wis| |00000e90| 68 20 74 6f 20 75 73 65 | 20 74 68 65 20 64 65 66 |h to use| the def| |00000ea0| 61 75 6c 74 20 46 72 61 | 6d 65 53 75 62 72 6f 75 |ault Fra|meSubrou| |00000eb0| 74 69 6e 65 28 29 20 69 | 6e 73 74 65 61 64 20 6f |tine() i|nstead o| |00000ec0| 66 20 77 72 69 74 69 6e | 67 20 79 6f 75 72 20 6f |f writin|g your o| |00000ed0| 77 6e 2e 0d 50 75 74 20 | 74 68 65 20 61 64 64 72 |wn..Put |the addr| |00000ee0| 65 73 73 20 6f 66 20 77 | 68 61 74 65 76 65 72 20 |ess of w|hatever | |00000ef0| 72 6f 75 74 69 6e 65 20 | 79 6f 75 20 77 61 6e 74 |routine |you want| |00000f00| 20 74 6f 20 75 73 65 20 | 69 6e 74 6f 20 74 68 65 | to use |into the| |00000f10| 20 22 73 75 62 72 6f 75 | 74 69 6e 65 22 0d 65 6c | "subrou|tine".el| |00000f20| 65 6d 65 6e 74 20 6f 66 | 20 74 68 65 20 56 42 4c |ement of| the VBL| |00000f30| 54 61 73 6b 41 6e 64 41 | 35 20 73 74 72 75 63 74 |TaskAndA|5 struct| |00000f40| 75 72 65 2c 20 6f 72 2c | 20 74 6f 20 72 65 71 75 |ure, or,| to requ| |00000f50| 65 73 74 20 75 73 65 20 | 6f 66 20 46 72 61 6d 65 |est use |of Frame| |00000f60| 53 75 62 72 6f 75 74 69 | 6e 65 2c 0d 73 75 70 70 |Subrouti|ne,.supp| |00000f70| 6c 79 20 74 68 65 20 61 | 64 64 72 65 73 73 20 4e |ly the a|ddress N| |00000f80| 55 4c 4c 2e 20 48 6f 77 | 65 76 65 72 2c 20 69 66 |ULL. How|ever, if| |00000f90| 20 79 6f 75 72 20 63 6f | 6d 70 69 6c 65 72 20 75 | your co|mpiler u| |00000fa0| 73 65 73 20 55 6e 69 76 | 65 72 73 61 6c 20 48 65 |ses Univ|ersal He| |00000fb0| 61 64 65 72 73 2c 20 74 | 68 65 6e 20 79 6f 75 20 |aders, t|hen you | |00000fc0| 0d 6d 75 73 74 20 73 75 | 70 70 6c 79 20 61 20 55 |.must su|pply a U| |00000fd0| 6e 69 76 65 72 73 61 6c | 20 50 72 6f 63 65 64 75 |niversal| Procedu| |00000fe0| 72 65 20 50 6f 69 6e 74 | 65 72 20 69 6e 73 74 65 |re Point|er inste| |00000ff0| 61 64 20 6f 66 20 74 68 | 65 20 73 75 62 72 6f 75 |ad of th|e subrou| |00001000| 74 69 6e 65 20 61 64 64 | 72 65 73 73 3a 0d 0d 23 |tine add|ress:..#| |00001010| 69 66 20 47 45 4e 45 52 | 41 54 49 4e 47 43 46 4d |if GENER|ATINGCFM| |00001020| 0d 09 6e 6f 69 73 65 56 | 42 4c 2e 73 75 62 72 6f |..noiseV|BL.subro| |00001030| 75 74 69 6e 65 3d 4e 65 | 77 56 42 4c 50 72 6f 63 |utine=Ne|wVBLProc| |00001040| 28 6d 79 52 6f 75 74 69 | 6e 65 29 3b 0d 23 65 6c |(myRouti|ne);.#el| |00001050| 73 65 0d 09 6e 6f 69 73 | 65 56 42 4c 2e 73 75 62 |se..nois|eVBL.sub| |00001060| 72 6f 75 74 69 6e 65 3d | 6d 79 52 6f 75 74 69 6e |routine=|myRoutin| |00001070| 65 3b 0d 23 65 6e 64 69 | 66 0d 0d 46 72 61 6d 65 |e;.#endi|f..Frame| |00001080| 53 75 62 72 6f 75 74 69 | 6e 65 28 29 20 75 73 65 |Subrouti|ne() use| |00001090| 73 20 54 69 6d 65 72 2e | 63 2e 20 49 66 20 74 68 |s Timer.|c. If th| |000010a0| 69 73 20 70 72 6f 67 72 | 61 6d 20 72 75 6e 73 20 |is progr|am runs | |000010b0| 6f 6e 20 61 6e 20 6f 6c | 64 20 53 79 73 74 65 6d |on an ol|d System| |000010c0| 20 28 70 72 65 0d 36 2e | 30 35 3f 29 20 6c 61 63 | (pre.6.|05?) lac| |000010d0| 6b 69 6e 67 20 74 68 65 | 20 52 65 76 69 73 65 64 |king the| Revised| |000010e0| 20 54 69 6d 65 20 4d 61 | 6e 61 67 65 72 2c 20 77 | Time Ma|nager, w| |000010f0| 68 69 63 68 20 54 69 6d | 65 72 2e 63 20 72 65 71 |hich Tim|er.c req| |00001100| 75 69 72 65 73 2c 20 74 | 68 65 6e 0d 53 69 6d 70 |uires, t|hen.Simp| |00001110| 6c 65 56 42 4c 53 75 62 | 72 6f 75 74 69 6e 65 28 |leVBLSub|routine(| |00001120| 29 20 77 69 6c 6c 20 62 | 65 20 75 73 65 64 20 69 |) will b|e used i| |00001130| 6e 73 74 65 61 64 2e 20 | 54 68 65 20 54 69 6d 65 |nstead. |The Time| |00001140| 72 20 69 73 20 75 73 65 | 64 20 74 6f 20 64 69 73 |r is use|d to dis| |00001150| 63 61 72 64 0d 73 70 75 | 72 69 6f 75 73 20 69 6e |card.spu|rious in| |00001160| 74 65 72 72 75 70 74 73 | 20 74 68 61 74 20 6f 63 |terrupts| that oc| |00001170| 63 75 72 20 77 69 74 68 | 69 6e 20 35 20 6d 73 20 |cur with|in 5 ms | |00001180| 6f 66 20 74 68 65 20 70 | 72 65 76 69 6f 75 73 2e |of the p|revious.| |00001190| 20 54 68 69 73 20 69 73 | 20 6e 65 63 65 73 73 61 | This is| necessa| |000011a0| 72 79 0d 62 65 63 61 75 | 73 65 20 73 6f 6d 65 20 |ry.becau|se some | |000011b0| 6f 66 20 74 68 65 20 41 | 70 70 6c 65 20 76 69 64 |of the A|pple vid| |000011c0| 65 6f 20 63 61 72 64 73 | 20 67 65 6e 65 72 61 74 |eo cards| generat| |000011d0| 65 20 73 65 76 65 72 61 | 6c 20 69 6e 74 65 72 72 |e severa|l interr| |000011e0| 75 70 74 73 20 64 75 72 | 69 6e 67 20 74 68 65 0d |upts dur|ing the.| |000011f0| 76 65 72 74 69 63 61 6c | 20 62 6c 61 6e 6b 69 6e |vertical| blankin| |00001200| 67 20 69 6e 74 65 72 76 | 61 6c 2c 20 65 76 65 6e |g interv|al, even| |00001210| 20 74 68 6f 75 67 68 20 | 41 70 70 6c 65 27 73 20 | though |Apple's | |00001220| 64 6f 63 75 6d 65 6e 74 | 61 74 69 6f 6e 20 63 6c |document|ation cl| |00001230| 65 61 72 6c 79 20 69 6e | 64 69 63 61 74 65 73 0d |early in|dicates.| |00001240| 74 68 61 74 20 74 68 65 | 79 20 73 68 6f 75 6c 64 |that the|y should| |00001250| 20 6f 6e 6c 79 20 67 65 | 6e 65 72 61 74 65 20 6f | only ge|nerate o| |00001260| 6e 65 2e 20 54 68 65 20 | 66 69 78 20 28 68 6f 6c |ne. The |fix (hol| |00001270| 64 69 6e 67 20 6f 66 66 | 20 66 6f 72 20 35 20 6d |ding off| for 5 m| |00001280| 73 29 20 77 61 73 20 73 | 75 67 67 65 73 74 65 64 |s) was s|uggested| |00001290| 0d 62 79 20 52 61 79 6e | 61 6c 64 20 43 6f 6d 74 |.by Rayn|ald Comt| |000012a0| 6f 69 73 2e 0d 0d 54 68 | 65 20 31 39 39 32 20 41 |ois...Th|e 1992 A| |000012b0| 70 70 6c 65 20 22 49 6e | 73 69 64 65 20 4d 61 63 |pple "In|side Mac| |000012c0| 69 6e 74 6f 73 68 3a 20 | 50 72 6f 63 65 73 73 65 |intosh: |Processe| |000012d0| 73 22 20 62 6f 6f 6b 20 | 65 78 70 6c 61 69 6e 73 |s" book |explains| |000012e0| 20 68 6f 77 20 74 6f 20 | 63 6f 64 65 20 61 20 74 | how to |code a t| |000012f0| 61 73 6b 0d 74 68 61 74 | 20 69 73 20 74 6f 20 62 |ask.that| is to b| |00001300| 65 20 70 65 72 66 6f 72 | 6d 65 64 20 65 61 63 68 |e perfor|med each| |00001310| 20 74 69 6d 65 20 79 6f | 75 72 20 76 69 64 65 6f | time yo|ur video| |00001320| 20 64 65 76 69 63 65 20 | 70 72 6f 64 75 63 65 73 | device |produces| |00001330| 20 61 20 76 65 72 74 69 | 63 61 6c 20 62 6c 61 6e | a verti|cal blan| |00001340| 6b 69 6e 67 0d 6c 65 76 | 65 6c 20 28 69 2e 65 2e |king.lev|el (i.e.| |00001350| 20 62 65 74 77 65 65 6e | 20 76 69 64 65 6f 20 66 | between| video f| |00001360| 72 61 6d 65 73 29 2e 20 | 49 74 27 73 20 71 75 69 |rames). |It's qui| |00001370| 74 65 20 74 72 69 63 6b | 79 2e 20 54 68 65 72 65 |te trick|y. There| |00001380| 66 6f 72 65 20 49 20 77 | 72 6f 74 65 20 61 0d 67 |fore I w|rote a.g| |00001390| 65 6e 65 72 69 63 20 6f | 6e 65 2c 20 74 68 61 74 |eneric o|ne, that| |000013a0| 20 69 6e 20 74 75 72 6e | 2c 20 63 61 6c 6c 73 20 | in turn|, calls | |000013b0| 79 6f 75 72 20 63 75 73 | 74 6f 6d 20 6f 6e 65 2c |your cus|tom one,| |000013c0| 20 61 66 74 65 72 20 61 | 6c 6c 20 74 68 65 20 74 | after a|ll the t| |000013d0| 72 69 63 6b 79 20 62 69 | 74 73 20 68 61 76 65 0d |ricky bi|ts have.| |000013e0| 62 65 65 6e 20 74 61 6b | 65 6e 20 63 61 72 65 20 |been tak|en care | |000013f0| 6f 66 2e 0d 0d 54 68 65 | 72 65 20 61 72 65 20 73 |of...The|re are s| |00001400| 6f 6d 65 20 73 75 62 74 | 6c 65 74 69 65 73 20 74 |ome subt|leties t| |00001410| 6f 20 74 68 65 20 56 42 | 4c 20 69 6e 74 65 72 72 |o the VB|L interr| |00001420| 75 70 74 20 73 65 72 76 | 69 63 65 20 72 6f 75 74 |upt serv|ice rout| |00001430| 69 6e 65 2e 20 54 68 65 | 20 6d 61 69 6e 20 6f 6e |ine. The| main on| |00001440| 65 20 69 73 0d 74 68 61 | 74 20 61 6c 6c 20 74 68 |e is.tha|t all th| |00001450| 65 20 4d 61 63 69 6e 74 | 6f 73 68 20 63 6f 6d 70 |e Macint|osh comp| |00001460| 69 6c 65 72 73 20 72 65 | 66 65 72 65 6e 63 65 20 |ilers re|ference | |00001470| 67 6c 6f 62 61 6c 20 76 | 61 72 69 61 62 6c 65 73 |global v|ariables| |00001480| 20 72 65 6c 61 74 69 76 | 65 20 74 6f 20 72 65 67 | relativ|e to reg| |00001490| 69 73 74 65 72 0d 41 35 | 2c 20 62 75 74 20 72 65 |ister.A5|, but re| |000014a0| 67 69 73 74 65 72 20 41 | 35 20 6d 61 79 20 68 61 |gister A|5 may ha| |000014b0| 76 65 20 74 68 65 20 77 | 72 6f 6e 67 20 76 61 6c |ve the w|rong val| |000014c0| 75 65 20 28 63 6f 72 72 | 65 73 70 6f 6e 64 69 6e |ue (corr|espondin| |000014d0| 67 20 74 6f 20 61 20 64 | 69 66 66 65 72 65 6e 74 |g to a d|ifferent| |000014e0| 0d 61 70 70 6c 69 63 61 | 74 69 6f 6e 29 20 61 74 |.applica|tion) at| |000014f0| 20 69 6e 74 65 72 72 75 | 70 74 20 74 69 6d 65 2e | interru|pt time.| |00001500| 20 53 6f 20 77 65 20 73 | 61 76 65 20 74 68 65 20 | So we s|ave the | |00001510| 72 69 67 68 74 20 76 61 | 6c 75 65 20 6f 66 20 41 |right va|lue of A| |00001520| 35 20 69 6e 73 69 64 65 | 20 6f 75 72 0d 73 74 72 |5 inside| our.str| |00001530| 75 63 74 75 72 65 20 61 | 6e 64 20 72 65 73 74 6f |ucture a|nd resto| |00001540| 72 65 20 41 35 20 62 65 | 66 6f 72 65 20 63 61 6c |re A5 be|fore cal| |00001550| 6c 69 6e 67 20 6f 75 72 | 20 54 61 73 6b 28 29 2e |ling our| Task().| |00001560| 0d 0d 41 20 66 75 72 74 | 68 65 72 20 73 75 62 74 |..A furt|her subt| |00001570| 6c 65 74 79 20 69 73 20 | 74 68 61 74 20 74 68 65 |lety is |that the| |00001580| 20 6e 65 77 20 67 65 6e | 65 72 61 74 69 6f 6e 20 | new gen|eration | |00001590| 6f 66 20 6f 70 74 69 6d | 69 7a 69 6e 67 20 63 6f |of optim|izing co| |000015a0| 6d 70 69 6c 65 72 73 20 | 6d 69 67 68 74 0d 6e 6f |mpilers |might.no| |000015b0| 74 69 63 65 20 74 68 61 | 74 20 41 35 20 69 73 20 |tice tha|t A5 is | |000015c0| 62 65 69 6e 67 20 6d 6f | 64 69 66 69 65 64 2c 20 |being mo|dified, | |000015d0| 73 6f 20 69 74 20 77 6f | 75 6c 64 20 62 65 20 64 |so it wo|uld be d| |000015e0| 61 6e 67 65 72 6f 75 73 | 20 74 6f 20 61 63 63 65 |angerous| to acce| |000015f0| 73 73 20 67 6c 6f 62 61 | 6c 73 20 61 74 0d 61 6c |ss globa|ls at.al| |00001600| 6c 20 69 6e 20 49 6e 74 | 65 72 72 75 70 74 53 65 |l in Int|erruptSe| |00001610| 72 76 69 63 65 52 6f 75 | 74 69 6e 65 28 29 2c 20 |rviceRou|tine(), | |00001620| 65 76 65 6e 20 74 68 6f | 75 67 68 20 69 74 27 73 |even tho|ugh it's| |00001630| 20 73 61 66 65 20 74 6f | 20 64 6f 20 73 6f 20 69 | safe to| do so i| |00001640| 6e 20 54 61 73 6b 28 29 | 2e 20 49 6e 0d 66 61 63 |n Task()|. In.fac| |00001650| 74 20 54 61 73 6b 28 29 | 20 64 6f 65 73 6e 27 74 |t Task()| doesn't| |00001660| 20 75 73 65 20 61 6e 79 | 20 67 6c 6f 62 61 6c 73 | use any| globals| |00001670| 2c 20 62 75 74 20 69 74 | 20 63 6f 75 6c 64 2e 0d |, but it| could..| |00001680| 0d 54 68 65 20 66 61 63 | 74 20 74 68 61 74 20 74 |.The fac|t that t| |00001690| 68 65 20 61 64 64 72 65 | 73 73 20 6f 66 20 6f 75 |he addre|ss of ou| |000016a0| 72 20 73 74 72 75 63 74 | 75 72 65 20 69 73 20 69 |r struct|ure is i| |000016b0| 6e 20 72 65 67 69 73 74 | 65 72 20 41 30 20 77 68 |n regist|er A0 wh| |000016c0| 65 6e 20 74 68 65 20 69 | 6e 74 65 72 72 75 70 74 |en the i|nterrupt| |000016d0| 0d 73 65 72 76 69 63 65 | 20 72 6f 75 74 69 6e 65 |.service| routine| |000016e0| 20 69 73 20 63 61 6c 6c | 65 64 20 72 65 73 75 6c | is call|ed resul| |000016f0| 74 73 20 66 72 6f 6d 20 | 74 68 65 20 66 61 63 74 |ts from |the fact| |00001700| 20 74 68 61 74 20 74 68 | 65 20 6c 6f 77 20 6c 65 | that th|e low le| |00001710| 76 65 6c 20 68 61 72 64 | 77 61 72 65 20 56 42 4c |vel hard|ware VBL| |00001720| 0d 69 6e 74 65 72 72 75 | 70 74 20 69 73 20 69 6e |.interru|pt is in| |00001730| 74 65 72 63 65 70 74 65 | 64 20 62 79 20 74 68 65 |tercepte|d by the| |00001740| 20 6f 70 65 72 61 74 69 | 6e 67 20 73 79 73 74 65 | operati|ng syste| |00001750| 6d 2c 20 77 68 69 63 68 | 20 74 68 65 6e 20 63 61 |m, which| then ca| |00001760| 6c 6c 73 20 6f 75 72 20 | 72 6f 75 74 69 6e 65 2e |lls our |routine.| |00001770| 0d 0d 54 68 65 20 56 42 | 4c 54 61 73 6b 41 6e 64 |..The VB|LTaskAnd| |00001780| 41 35 20 73 74 72 75 63 | 74 20 65 78 74 65 6e 64 |A5 struc|t extend| |00001790| 73 20 41 70 70 6c 65 27 | 73 20 56 42 4c 54 61 73 |s Apple'|s VBLTas| |000017a0| 6b 20 73 74 72 75 63 74 | 20 62 79 20 61 64 64 69 |k struct| by addi| |000017b0| 6e 67 20 73 6f 6d 65 20 | 75 73 65 66 75 6c 0d 69 |ng some |useful.i| |000017c0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 74 20 74 68 |nformati|on at th| |000017d0| 65 20 65 6e 64 2e 20 59 | 6f 75 20 6d 61 79 20 63 |e end. Y|ou may c| |000017e0| 68 6f 6f 73 65 20 74 6f | 20 63 6f 70 79 20 74 68 |hoose to| copy th| |000017f0| 69 73 2c 20 6f 72 20 64 | 65 66 69 6e 65 20 79 6f |is, or d|efine yo| |00001800| 75 72 20 6f 77 6e 2c 20 | 61 64 64 69 6e 67 0d 6d |ur own, |adding.m| |00001810| 6f 72 65 20 73 74 75 66 | 66 20 61 74 20 74 68 65 |ore stuf|f at the| |00001820| 20 65 6e 64 2e 20 48 6f | 77 65 76 65 72 2c 20 79 | end. Ho|wever, y| |00001830| 6f 75 20 6d 61 79 20 6e | 6f 74 20 77 61 6e 74 20 |ou may n|ot want | |00001840| 74 6f 20 62 6f 74 68 65 | 72 2c 20 63 6f 6e 73 69 |to bothe|r, consi| |00001850| 64 65 72 69 6e 67 20 74 | 68 61 74 0d 79 6f 75 72 |dering t|hat.your| |00001860| 20 69 6e 74 65 72 72 75 | 70 74 20 73 65 72 76 69 | interru|pt servi| |00001870| 63 65 20 72 6f 75 74 69 | 6e 65 20 63 61 6e 20 66 |ce routi|ne can f| |00001880| 72 65 65 6c 79 20 61 63 | 63 65 73 73 20 67 6c 6f |reely ac|cess glo| |00001890| 62 61 6c 20 76 61 72 69 | 61 62 6c 65 73 2e 0d 41 |bal vari|ables..A| |000018a0| 6c 74 65 72 6e 61 74 69 | 76 65 6c 79 2c 20 49 20 |lternati|vely, I | |000018b0| 61 64 64 65 64 20 61 20 | 67 65 6e 65 72 69 63 20 |added a |generic | |000018c0| 70 6f 69 6e 74 65 72 20 | 61 74 20 74 68 65 20 65 |pointer |at the e| |000018d0| 6e 64 2c 20 77 68 69 63 | 68 20 79 6f 75 20 6d 61 |nd, whic|h you ma| |000018e0| 79 20 75 73 65 20 74 6f | 20 70 61 73 73 0d 74 68 |y use to| pass.th| |000018f0| 65 20 61 64 64 72 65 73 | 73 20 6f 66 20 61 6e 79 |e addres|s of any| |00001900| 20 73 74 75 66 66 20 74 | 68 61 74 20 79 6f 75 20 | stuff t|hat you | |00001910| 77 61 6e 74 20 74 6f 20 | 61 63 63 65 73 73 20 77 |want to |access w| |00001920| 69 74 68 69 6e 20 79 6f | 75 72 20 73 75 62 72 6f |ithin yo|ur subro| |00001930| 75 74 69 6e 65 2e 0d 0d | 4d 61 63 69 6e 74 6f 73 |utine...|Macintos| |00001940| 68 20 54 65 63 68 6e 69 | 63 61 6c 20 4e 6f 74 65 |h Techni|cal Note| |00001950| 20 31 38 30 20 28 22 4d | 75 6c 74 69 66 69 6e 64 | 180 ("M|ultifind| |00001960| 65 72 20 4d 69 73 63 65 | 6c 6c 61 6e 65 61 22 29 |er Misce|llanea")| |00001970| 2c 20 70 2e 20 35 20 73 | 61 79 73 3a 0d 22 47 65 |, p. 5 s|ays:."Ge| |00001980| 74 56 42 4c 52 65 63 28 | 29 20 72 65 74 75 72 6e |tVBLRec(|) return| |00001990| 73 20 74 68 65 20 61 64 | 64 72 65 73 73 20 6f 66 |s the ad|dress of| |000019a0| 20 74 68 65 20 56 42 4c | 52 65 63 20 61 73 73 6f | the VBL|Rec asso| |000019b0| 63 69 61 74 65 64 20 77 | 69 74 68 20 6f 75 72 20 |ciated w|ith our | |000019c0| 56 42 4c 20 74 61 73 6b | 2e 0d 54 68 69 73 20 77 |VBL task|..This w| |000019d0| 6f 72 6b 73 20 62 65 63 | 61 75 73 65 20 6f 6e 20 |orks bec|ause on | |000019e0| 65 6e 74 72 79 20 69 6e | 74 6f 20 74 68 65 20 56 |entry in|to the V| |000019f0| 42 4c 20 74 61 73 6b 2c | 20 41 30 20 70 6f 69 6e |BL task,| A0 poin| |00001a00| 74 73 20 74 6f 20 74 68 | 65 20 74 68 65 56 42 4c |ts to th|e theVBL| |00001a10| 54 61 73 6b 20 66 69 65 | 6c 64 0d 69 6e 20 74 68 |Task fie|ld.in th| |00001a20| 65 20 56 42 4c 52 65 63 | 20 72 65 63 6f 72 64 2c |e VBLRec| record,| |00001a30| 20 77 68 69 63 68 20 69 | 73 20 74 68 65 20 66 69 | which i|s the fi| |00001a40| 72 73 74 20 66 69 65 6c | 64 20 69 6e 20 74 68 65 |rst fiel|d in the| |00001a50| 20 72 65 63 6f 72 64 20 | 61 6e 64 20 74 68 61 74 | record |and that| |00001a60| 20 69 73 20 74 68 65 0d | 61 64 64 72 65 73 73 20 | is the.|address | |00001a70| 77 65 20 72 65 74 75 72 | 6e 2e 20 4e 6f 74 65 20 |we retur|n. Note | |00001a80| 74 68 61 74 20 74 68 69 | 73 20 6d 65 74 68 6f 64 |that thi|s method| |00001a90| 20 77 6f 72 6b 73 20 77 | 68 65 74 68 65 72 20 74 | works w|hether t| |00001aa0| 68 65 20 56 42 4c 52 65 | 63 20 69 73 20 61 6c 6c |he VBLRe|c is all| |00001ab0| 6f 63 61 74 65 64 0d 67 | 6c 6f 62 61 6c 6c 79 2c |ocated.g|lobally,| |00001ac0| 20 69 6e 20 74 68 65 20 | 68 65 61 70 2e 2e 2e 6f | in the |heap...o| |00001ad0| 72 2e 2e 2e 6f 6e 20 74 | 68 65 20 73 74 61 63 6b |r...on t|he stack| |00001ae0| 2e 20 2e 2e 2e 20 54 68 | 69 73 20 74 72 69 63 6b |. ... Th|is trick| |00001af0| 20 61 6c 6c 6f 77 73 20 | 75 73 20 74 6f 20 67 65 | allows |us to ge| |00001b00| 74 20 74 6f 0d 74 68 65 | 20 73 61 76 65 64 20 41 |t to.the| saved A| |00001b10| 35 2c 20 62 75 74 20 69 | 74 20 63 6f 75 6c 64 20 |5, but i|t could | |00001b20| 61 6c 73 6f 20 62 65 20 | 75 73 65 64 20 74 6f 20 |also be |used to | |00001b30| 67 65 74 20 74 6f 20 61 | 6e 79 74 68 69 6e 67 20 |get to a|nything | |00001b40| 77 65 20 77 61 6e 74 65 | 64 20 74 6f 20 73 74 6f |we wante|d to sto| |00001b50| 72 65 20 69 6e 0d 74 68 | 65 20 72 65 63 6f 72 64 |re in.th|e record| |00001b60| 2e 22 20 28 71 75 6f 74 | 65 64 20 62 79 20 4a 61 |." (quot|ed by Ja| |00001b70| 6d 69 65 20 4d 63 43 61 | 72 74 68 79 20 69 6e 20 |mie McCa|rthy in | |00001b80| 63 6f 6d 70 2e 73 79 73 | 2e 6d 61 63 2e 70 72 6f |comp.sys|.mac.pro| |00001b90| 67 20 31 30 2f 31 35 2f | 39 32 2e 29 0d 0d 48 49 |g 10/15/|92.)..HI| |00001ba0| 53 54 4f 52 59 3a 0d 38 | 2f 32 32 2f 39 32 20 64 |STORY:.8|/22/92 d| |00001bb0| 67 70 20 77 72 6f 74 65 | 20 69 74 2c 20 62 61 73 |gp wrote| it, bas| |00001bc0| 65 64 20 6f 6e 20 63 6f | 64 65 20 65 78 74 72 61 |ed on co|de extra| |00001bd0| 63 74 65 64 20 66 72 6f | 6d 20 6d 79 20 4e 6f 69 |cted fro|m my Noi| |00001be0| 73 65 56 42 4c 2e 63 0d | 38 2f 32 36 2f 39 32 09 |seVBL.c.|8/26/92.| |00001bf0| 64 67 70 09 61 64 64 65 | 64 20 56 42 4c 52 65 6d |dgp.adde|d VBLRem| |00001c00| 6f 76 65 41 6c 6c 28 29 | 2c 20 77 68 69 63 68 20 |oveAll()|, which | |00001c10| 69 73 20 61 75 74 6f 6d | 61 74 69 63 61 6c 6c 79 |is autom|atically| |00001c20| 20 70 6c 61 63 65 64 20 | 69 6e 20 74 68 65 20 5f | placed |in the _| |00001c30| 61 74 65 78 69 74 28 29 | 0d 09 09 09 71 75 65 75 |atexit()|....queu| |00001c40| 65 2c 20 73 6f 20 69 74 | 20 61 6c 6c 20 79 6f 75 |e, so it| all you| |00001c50| 72 20 56 42 4c 20 74 61 | 73 6b 73 20 77 69 6c 6c |r VBL ta|sks will| |00001c60| 20 62 65 20 72 65 6d 6f | 76 65 64 20 66 72 6f 6d | be remo|ved from| |00001c70| 20 74 68 65 20 71 75 65 | 75 65 20 77 68 65 6e 0d | the que|ue when.| |00001c80| 09 09 09 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 20 |...your |program | |00001c90| 65 78 69 74 73 2c 20 77 | 68 65 74 68 65 72 20 6e |exits, w|hether n| |00001ca0| 6f 72 6d 61 6c 20 6f 72 | 20 61 62 6e 6f 72 6d 61 |ormal or| abnorma| |00001cb0| 6c 6c 79 2e 0d 39 2f 39 | 2f 39 32 09 64 67 70 09 |lly..9/9|/92.dgp.| |00001cc0| 66 69 78 65 64 20 65 72 | 72 6f 6e 65 6f 75 73 20 |fixed er|roneous | |00001cd0| 61 74 74 65 6d 70 74 20 | 74 6f 20 75 73 65 20 73 |attempt |to use s| |00001ce0| 6c 6f 74 20 7a 65 72 6f | 20 77 68 65 6e 20 4e 55 |lot zero| when NU| |00001cf0| 4c 4c 20 64 65 76 69 63 | 65 20 77 61 73 20 70 61 |LL devic|e was pa| |00001d00| 73 73 65 64 2e 0d 39 2f | 31 30 2f 39 32 09 64 67 |ssed..9/|10/92.dg| |00001d10| 70 09 61 64 64 65 64 20 | 63 61 6c 6c 73 20 74 6f |p.added |calls to| |00001d20| 20 56 4d 20 74 6f 20 48 | 6f 6c 64 4d 65 6d 6f 72 | VM to H|oldMemor| |00001d30| 79 28 29 20 61 6e 64 20 | 55 6e 48 6f 6c 64 4d 65 |y() and |UnHoldMe| |00001d40| 6d 6f 72 79 28 29 2e 20 | 41 63 63 6f 72 64 69 6e |mory(). |Accordin| |00001d50| 67 20 74 6f 20 41 70 70 | 6c 65 27 73 0d 09 09 09 |g to App|le's....| |00001d60| 4d 65 6d 6f 72 79 20 62 | 6f 6f 6b 20 74 68 69 73 |Memory b|ook this| |00001d70| 20 69 73 6e 27 74 20 73 | 74 72 69 63 74 6c 79 20 | isn't s|trictly | |00001d80| 6e 65 63 65 73 73 61 72 | 79 2c 20 73 69 6e 63 65 |necessar|y, since| |00001d90| 20 56 42 4c 20 74 61 73 | 6b 73 20 77 69 6c 6c 20 | VBL tas|ks will | |00001da0| 0d 09 09 09 62 65 20 63 | 61 6c 6c 65 64 20 6f 6e |....be c|alled on| |00001db0| 6c 79 20 77 68 65 6e 20 | 69 74 27 73 20 73 61 66 |ly when |it's saf| |00001dc0| 65 2e 0d 39 2f 31 37 2f | 39 32 09 64 67 70 09 54 |e..9/17/|92.dgp.T| |00001dd0| 72 61 6e 73 66 65 72 72 | 65 64 20 46 72 61 6d 65 |ransferr|ed Frame| |00001de0| 53 75 62 72 6f 75 74 69 | 6e 65 28 29 20 68 65 72 |Subrouti|ne() her| |00001df0| 65 20 66 72 6f 6d 20 47 | 44 46 72 61 6d 65 52 61 |e from G|DFrameRa| |00001e00| 74 65 2e 63 2e 20 4e 6f | 77 20 75 73 65 20 0d 09 |te.c. No|w use ..| |00001e10| 09 09 46 72 61 6d 65 53 | 75 62 72 6f 75 74 69 6e |..FrameS|ubroutin| |00001e20| 65 28 29 20 69 6e 73 74 | 65 61 64 20 6f 66 20 53 |e() inst|ead of S| |00001e30| 69 6d 70 6c 65 56 42 4c | 53 75 62 72 6f 75 74 69 |impleVBL|Subrouti| |00001e40| 6e 65 28 29 20 61 73 20 | 74 68 65 20 64 65 66 61 |ne() as |the defa| |00001e50| 75 6c 74 2c 0d 09 09 09 | 70 72 6f 76 69 64 65 64 |ult,....|provided| |00001e60| 20 77 65 20 63 61 6e 20 | 75 73 65 20 54 69 6d 65 | we can |use Time| |00001e70| 72 2e 63 2c 20 6f 74 68 | 65 72 77 69 73 65 20 66 |r.c, oth|erwise f| |00001e80| 61 6c 6c 20 62 61 63 6b | 20 74 6f 20 75 73 69 6e |all back| to usin| |00001e90| 67 20 0d 09 09 09 53 69 | 6d 70 6c 65 56 42 4c 53 |g ....Si|mpleVBLS| |00001ea0| 75 62 72 6f 75 74 69 6e | 65 2e 0d 31 30 2f 39 2f |ubroutin|e..10/9/| |00001eb0| 39 32 09 64 67 70 09 41 | 75 74 6f 6d 61 74 69 63 |92.dgp.A|utomatic| |00001ec0| 61 6c 6c 79 20 73 65 74 | 20 75 70 20 61 6e 64 20 |ally set| up and | |00001ed0| 64 69 73 70 6f 73 65 20 | 6f 66 20 74 68 65 20 74 |dispose |of the t| |00001ee0| 69 6d 65 72 20 75 73 65 | 64 20 62 79 20 46 72 61 |imer use|d by Fra| |00001ef0| 6d 65 53 75 62 72 6f 75 | 74 69 6e 65 2e 0d 09 09 |meSubrou|tine....| |00001f00| 09 41 64 64 65 64 20 61 | 20 66 69 65 6c 64 20 74 |.Added a| field t| |00001f10| 6f 20 74 68 65 20 56 42 | 4c 54 61 73 6b 41 6e 64 |o the VB|LTaskAnd| |00001f20| 41 35 20 73 74 72 75 63 | 74 75 72 65 20 74 6f 20 |A5 struc|ture to | |00001f30| 68 6f 6c 64 20 74 68 65 | 20 74 69 6d 65 72 20 70 |hold the| timer p| |00001f40| 6f 69 6e 74 65 72 2c 0d | 09 09 09 69 6e 73 74 65 |ointer,.|...inste| |00001f50| 61 64 20 6f 66 20 75 73 | 69 6e 67 20 75 70 20 74 |ad of us|ing up t| |00001f60| 68 65 20 67 65 6e 65 72 | 69 63 20 70 74 72 2e 0d |he gener|ic ptr..| |00001f70| 09 09 09 57 41 52 4e 49 | 4e 47 3a 20 6f 6c 64 20 |...WARNI|NG: old | |00001f80| 70 72 6f 67 72 61 6d 73 | 20 28 77 72 69 74 74 65 |programs| (writte| |00001f90| 6e 20 64 75 72 69 6e 67 | 20 39 2f 39 32 29 20 74 |n during| 9/92) t| |00001fa0| 68 61 74 20 65 78 70 6c | 69 63 69 74 6c 79 20 72 |hat expl|icitly r| |00001fb0| 65 71 75 65 73 74 20 75 | 73 65 20 6f 66 20 0d 09 |equest u|se of ..| |00001fc0| 09 09 46 72 61 6d 65 53 | 75 62 72 6f 75 74 69 6e |..FrameS|ubroutin| |00001fd0| 65 20 6d 75 73 74 20 62 | 65 20 63 68 61 6e 67 65 |e must b|e change| |00001fe0| 64 2c 20 62 65 63 61 75 | 73 65 20 61 74 20 74 68 |d, becau|se at th| |00001ff0| 61 74 20 74 69 6d 65 20 | 69 74 20 77 61 73 20 74 |at time |it was t| |00002000| 68 65 20 75 73 65 72 27 | 73 20 0d 09 09 09 72 65 |he user'|s ....re| |00002010| 73 70 6f 6e 73 69 62 69 | 6c 69 74 79 20 74 6f 20 |sponsibi|lity to | |00002020| 73 65 74 20 75 70 20 61 | 6e 64 20 64 69 73 70 6f |set up a|nd dispo| |00002030| 73 65 20 6f 66 20 74 68 | 65 20 74 69 6d 65 72 2c |se of th|e timer,| |00002040| 20 77 68 65 72 65 61 73 | 20 69 74 27 73 20 6e 6f | whereas| it's no| |00002050| 77 20 64 6f 6e 65 20 0d | 09 09 09 66 6f 72 20 79 |w done .|...for y| |00002060| 6f 75 2e 20 54 6f 20 72 | 65 6d 69 6e 64 20 79 6f |ou. To r|emind yo| |00002070| 75 20 74 6f 20 6d 61 6b | 65 20 74 68 69 73 20 63 |u to mak|e this c| |00002080| 68 61 6e 67 65 20 22 46 | 72 61 6d 65 53 75 62 72 |hange "F|rameSubr| |00002090| 6f 75 74 69 6e 65 22 20 | 69 73 20 6e 6f 20 6c 6f |outine" |is no lo| |000020a0| 6e 67 65 72 20 0d 09 09 | 09 69 6e 20 56 69 64 65 |nger ...|.in Vide| |000020b0| 6f 54 6f 6f 6c 62 6f 78 | 2e 68 2c 20 69 74 27 73 |oToolbox|.h, it's| |000020c0| 20 74 72 65 61 74 65 64 | 20 61 73 20 61 20 70 72 | treated| as a pr| |000020d0| 69 76 61 74 65 20 72 6f | 75 74 69 6e 65 20 68 65 |ivate ro|utine he| |000020e0| 72 65 2e 20 54 6f 20 6f | 62 74 61 69 6e 20 74 68 |re. To o|btain th| |000020f0| 65 20 0d 09 09 09 73 65 | 72 76 69 63 65 73 20 6f |e ....se|rvices o| |00002100| 66 20 46 72 61 6d 65 53 | 75 62 72 6f 75 74 69 6e |f FrameS|ubroutin| |00002110| 65 2c 20 6a 75 73 74 20 | 73 70 65 63 69 66 79 20 |e, just |specify | |00002120| 61 20 4e 55 4c 4c 20 69 | 6e 20 74 68 65 20 56 42 |a NULL i|n the VB| |00002130| 4c 54 61 73 6b 41 6e 64 | 41 35 20 0d 09 09 09 73 |LTaskAnd|A5 ....s| |00002140| 75 62 72 6f 75 74 69 6e | 65 20 66 69 65 6c 64 2e |ubroutin|e field.| |00002150| 0d 31 31 2f 31 37 2f 39 | 32 20 64 67 70 20 49 6e |.11/17/9|2 dgp In| |00002160| 20 56 42 4c 52 65 6d 6f | 76 65 28 29 2c 20 66 69 | VBLRemo|ve(), fi| |00002170| 72 73 74 20 64 69 73 61 | 62 6c 65 20 74 68 65 20 |rst disa|ble the | |00002180| 69 6e 74 65 72 72 75 70 | 74 2c 20 74 68 65 6e 20 |interrup|t, then | |00002190| 63 6c 65 61 6e 20 75 70 | 2e 0d 09 09 09 46 69 78 |clean up|.....Fix| |000021a0| 65 64 20 65 72 72 6f 72 | 20 74 68 61 74 20 63 6f |ed error| that co| |000021b0| 75 6c 64 20 63 61 75 73 | 65 20 62 75 73 20 65 72 |uld caus|e bus er| |000021c0| 72 6f 72 20 69 6e 20 56 | 42 4c 52 65 6d 6f 76 65 |ror in V|BLRemove| |000021d0| 41 6c 6c 2e 0d 09 09 09 | 56 42 4c 49 6e 73 74 61 |All.....|VBLInsta| |000021e0| 6c 6c 28 29 20 6e 6f 77 | 20 69 6e 73 74 61 6c 6c |ll() now| install| |000021f0| 73 20 56 42 4c 52 65 6d | 6f 76 65 41 6c 6c 28 29 |s VBLRem|oveAll()| |00002200| 20 6f 6e 6c 79 20 6f 6e | 63 65 20 69 6e 20 74 68 | only on|ce in th| |00002210| 65 20 5f 61 74 65 78 69 | 74 28 29 0d 09 09 09 71 |e _atexi|t()....q| |00002220| 75 65 75 65 2c 20 6e 6f | 20 6d 61 74 74 65 72 20 |ueue, no| matter | |00002230| 68 6f 77 20 6d 61 6e 79 | 20 74 69 6d 65 73 20 79 |how many| times y| |00002240| 6f 75 20 63 61 6c 6c 20 | 69 74 2e 0d 31 31 2f 32 |ou call |it..11/2| |00002250| 34 2f 39 32 20 64 67 70 | 20 4d 69 6e 6f 72 20 75 |4/92 dgp| Minor u| |00002260| 70 64 61 74 69 6e 67 20 | 6f 66 20 63 6f 6d 6d 65 |pdating |of comme| |00002270| 6e 74 73 2e 0d 37 2f 39 | 2f 39 33 09 64 67 70 09 |nts..7/9|/93.dgp.| |00002280| 54 65 73 74 20 4d 41 54 | 4c 41 42 20 69 6e 20 69 |Test MAT|LAB in i| |00002290| 66 28 29 20 69 6e 73 74 | 65 61 64 20 6f 66 20 23 |f() inst|ead of #| |000022a0| 69 66 2e 20 0d 32 2f 32 | 38 2f 39 34 09 64 67 70 |if. .2/2|8/94.dgp| |000022b0| 09 49 6e 20 72 65 73 70 | 6f 6e 73 65 20 74 6f 20 |.In resp|onse to | |000022c0| 71 75 65 72 79 20 62 79 | 20 4d 69 6b 65 20 54 61 |query by| Mike Ta| |000022d0| 72 72 20 28 74 61 72 72 | 2d 6d 69 63 68 61 65 6c |rr (tarr|-michael| |000022e0| 40 43 53 2e 59 41 4c 45 | 2e 45 44 55 29 2c 20 63 |@CS.YALE|.EDU), c| |000022f0| 68 61 6e 67 65 64 20 0d | 09 09 09 66 72 61 6d 65 |hanged .|...frame| |00002300| 73 20 61 72 67 75 6d 65 | 6e 74 20 66 72 6f 6d 20 |s argume|nt from | |00002310| 69 6e 74 20 74 6f 20 6c | 6f 6e 67 2c 20 61 6e 64 |int to l|ong, and| |00002320| 20 6e 6f 77 20 61 6c 6c | 6f 77 20 66 72 61 6d 65 | now all|ow frame| |00002330| 73 3d 3d 2d 31 20 74 6f | 20 72 65 71 75 65 73 74 |s==-1 to| request| |00002340| 20 0d 09 09 09 74 68 61 | 74 20 74 68 65 20 69 6e | ....tha|t the in| |00002350| 74 65 72 72 75 70 74 20 | 73 65 72 76 69 63 65 20 |terrupt |service | |00002360| 72 6f 75 74 69 6e 65 20 | 63 6f 6e 74 69 6e 75 65 |routine |continue| |00002370| 20 77 6f 72 6b 69 6e 67 | 20 69 6e 64 65 66 69 6e | working| indefin| |00002380| 69 74 65 6c 79 2e 0d 33 | 2f 35 2f 39 34 09 64 67 |itely..3|/5/94.dg| |00002390| 70 09 49 6e 20 72 65 73 | 70 6f 6e 73 65 20 74 6f |p.In res|ponse to| |000023a0| 20 61 20 62 75 67 20 72 | 65 70 6f 72 74 20 62 79 | a bug r|eport by| |000023b0| 20 4d 69 6b 65 20 54 61 | 72 72 2c 20 66 69 6e 69 | Mike Ta|rr, fini| |000023c0| 73 68 65 64 20 74 68 65 | 20 32 2f 32 38 2f 39 34 |shed the| 2/28/94| |000023d0| 20 63 68 61 6e 67 65 2c | 0d 09 09 09 77 68 69 63 | change,|....whic| |000023e0| 68 20 49 27 64 20 66 6f | 6f 6c 69 73 68 6c 79 20 |h I'd fo|olishly | |000023f0| 6f 6e 6c 79 20 64 6f 6e | 65 20 74 6f 20 53 69 6d |only don|e to Sim| |00002400| 70 6c 65 56 42 4c 53 75 | 62 72 6f 75 74 69 6e 65 |pleVBLSu|broutine| |00002410| 20 61 6e 64 20 6e 6f 74 | 20 74 6f 20 0d 09 09 09 | and not| to ....| |00002420| 46 72 61 6d 65 53 75 62 | 72 6f 75 74 69 6e 65 2e |FrameSub|routine.| |00002430| 0d 35 2f 32 38 2f 39 34 | 09 64 67 70 09 4d 61 64 |.5/28/94|.dgp.Mad| |00002440| 65 20 63 6f 6d 70 61 74 | 69 62 6c 65 20 77 69 74 |e compat|ible wit| |00002450| 68 20 41 70 70 6c 65 27 | 73 20 55 6e 69 76 65 72 |h Apple'|s Univer| |00002460| 73 61 6c 20 48 65 61 64 | 65 72 73 2e 20 49 20 61 |sal Head|ers. I a| |00002470| 6c 73 6f 20 61 74 74 65 | 6d 70 74 65 64 20 74 6f |lso atte|mpted to| |00002480| 0d 09 09 09 6d 61 6b 65 | 20 74 68 65 20 63 6f 64 |....make| the cod| |00002490| 65 20 50 6f 77 65 72 50 | 43 20 63 6f 6d 70 61 74 |e PowerP|C compat| |000024a0| 69 62 6c 65 2c 20 62 75 | 74 20 74 68 61 74 20 72 |ible, bu|t that r| |000024b0| 65 6d 61 69 6e 73 20 74 | 6f 20 62 65 20 74 65 73 |emains t|o be tes| |000024c0| 74 65 64 2e 0d 31 30 2f | 31 2f 39 34 09 64 67 70 |ted..10/|1/94.dgp| |000024d0| 09 41 64 64 65 64 20 6e | 65 77 20 22 66 72 61 6d |.Added n|ew "fram| |000024e0| 65 22 20 66 69 65 6c 64 | 20 74 6f 20 56 42 4c 54 |e" field| to VBLT| |000024f0| 61 73 6b 41 6e 64 41 35 | 20 73 74 72 75 63 74 2c |askAndA5| struct,| |00002500| 20 77 68 69 63 68 20 63 | 6f 75 6e 74 73 20 75 70 | which c|ounts up| |00002510| 20 66 72 6f 6d 20 7a 65 | 72 6f 2e 0d 31 30 2f 32 | from ze|ro..10/2| |00002520| 34 2f 39 34 20 64 67 70 | 20 4d 61 64 65 20 64 65 |4/94 dgp| Made de| |00002530| 63 6c 61 72 61 74 69 6f | 6e 20 6f 66 20 47 65 74 |claratio|n of Get| |00002540| 41 30 28 29 20 65 78 70 | 6c 69 63 69 74 6c 79 20 |A0() exp|licitly | |00002550| 69 6e 64 69 63 61 74 65 | 20 74 68 61 74 20 61 6e |indicate| that an| |00002560| 73 77 65 72 20 69 73 20 | 72 65 74 75 72 6e 65 64 |swer is |returned| |00002570| 20 69 6e 20 44 30 2c 20 | 66 6f 72 0d 62 65 74 74 | in D0, |for.bett| |00002580| 65 72 20 63 6f 6d 70 61 | 74 69 62 69 6c 69 74 79 |er compa|tibility| |00002590| 20 77 69 74 68 20 4d 65 | 74 72 6f 77 65 72 6b 73 | with Me|trowerks| |000025a0| 20 43 6f 64 65 57 61 72 | 72 69 6f 72 20 43 2e 0d | CodeWar|rior C..| |000025b0| 31 30 2f 32 37 2f 39 34 | 20 64 67 70 20 49 74 20 |10/27/94| dgp It | |000025c0| 69 73 20 76 65 72 79 20 | 61 6e 6e 6f 79 69 6e 67 |is very |annoying| |000025d0| 20 66 6f 72 20 74 68 65 | 20 6d 61 63 68 69 6e 65 | for the| machine| |000025e0| 20 74 6f 20 63 72 61 73 | 68 20 61 6e 79 74 69 6d | to cras|h anytim| |000025f0| 65 20 79 6f 75 20 74 72 | 79 20 74 6f 20 71 75 69 |e you tr|y to qui| |00002600| 74 20 79 6f 75 72 20 61 | 70 70 6c 69 63 61 74 69 |t your a|pplicati| |00002610| 6f 6e 0d 62 79 20 65 73 | 63 61 70 69 6e 67 20 76 |on.by es|caping v| |00002620| 69 61 20 4d 61 63 73 42 | 75 67 73 20 65 73 63 61 |ia MacsB|ugs esca| |00002630| 70 65 20 74 6f 20 73 68 | 65 6c 6c 2e 20 54 68 65 |pe to sh|ell. The| |00002640| 20 70 72 6f 62 6c 65 6d | 20 69 73 20 74 68 61 74 | problem| is that| |00002650| 20 43 6f 64 65 57 61 72 | 72 69 6f 72 20 34 2e 35 | CodeWar|rior 4.5| |00002660| 20 64 6f 65 73 6e 27 74 | 20 61 74 74 61 63 68 0d | doesn't| attach.| |00002670| 74 68 65 20 61 74 65 78 | 69 74 28 29 20 74 61 73 |the atex|it() tas| |00002680| 6b 73 20 74 6f 20 5f 45 | 73 63 61 70 65 54 6f 53 |ks to _E|scapeToS| |00002690| 68 65 6c 6c 2e 20 53 6f | 20 49 20 64 6f 20 69 74 |hell. So| I do it| |000026a0| 20 68 65 72 65 2e 20 0d | 35 2f 33 2f 39 35 20 64 | here. .|5/3/95 d| |000026b0| 67 70 20 66 69 78 65 64 | 20 74 65 73 74 20 66 6f |gp fixed| test fo| |000026c0| 72 20 70 72 65 73 65 6e | 63 65 20 6f 66 20 76 6d |r presen|ce of vm| |000026d0| 2c 20 77 68 69 63 68 20 | 62 65 66 6f 72 65 20 77 |, which |before w| |000026e0| 61 73 20 61 6c 77 61 79 | 73 20 72 65 74 75 72 6e |as alway|s return| |000026f0| 69 6e 67 20 66 61 6c 73 | 65 2e 0d 37 2f 31 2f 39 |ing fals|e..7/1/9| |00002700| 35 20 64 67 70 20 6a 75 | 73 74 20 63 61 6c 6c 20 |5 dgp ju|st call | |00002710| 41 74 45 78 69 74 54 6f | 53 68 65 6c 6c 28 29 2c |AtExitTo|Shell(),| |00002720| 20 77 69 74 68 6f 75 74 | 20 61 6e 79 20 63 6f 6e | without| any con| |00002730| 64 69 74 69 6f 6e 61 6c | 73 2e 20 53 70 65 63 69 |ditional|s. Speci| |00002740| 61 6c 20 63 61 73 65 73 | 2c 20 65 2e 67 2e 20 4d |al cases|, e.g. M| |00002750| 41 54 4c 41 42 2c 0d 61 | 72 65 20 68 61 6e 64 6c |ATLAB,.a|re handl| |00002760| 65 64 20 69 6e 20 41 74 | 45 78 69 74 54 6f 53 68 |ed in At|ExitToSh| |00002770| 65 6c 6c 2e 63 2e 0d 2a | 2f 0d 23 69 6e 63 6c 75 |ell.c..*|/.#inclu| |00002780| 64 65 20 22 56 69 64 65 | 6f 54 6f 6f 6c 62 6f 78 |de "Vide|oToolbox| |00002790| 2e 68 22 0d 23 69 66 6e | 64 65 66 20 5f 5f 54 52 |.h".#ifn|def __TR| |000027a0| 41 50 53 5f 5f 0d 09 23 | 69 6e 63 6c 75 64 65 20 |APS__..#|include | |000027b0| 3c 54 72 61 70 73 2e 68 | 3e 0d 23 65 6e 64 69 66 |<Traps.h|>.#endif| |000027c0| 0d 2f 2f 23 69 6e 63 6c | 75 64 65 20 3c 52 65 74 |.//#incl|ude <Ret| |000027d0| 72 61 63 65 2e 68 3e 0d | 76 6f 69 64 20 56 42 4c |race.h>.|void VBL| |000027e0| 52 65 6d 6f 76 65 41 6c | 6c 28 76 6f 69 64 29 3b |RemoveAl|l(void);| |000027f0| 0d 23 69 66 20 21 55 4e | 49 56 45 52 53 41 4c 5f |.#if !UN|IVERSAL_| |00002800| 48 45 41 44 45 52 53 0d | 09 74 79 70 65 64 65 66 |HEADERS.|.typedef| |00002810| 20 50 72 6f 63 50 74 72 | 20 55 6e 69 76 65 72 73 | ProcPtr| Univers| |00002820| 61 6c 50 72 6f 63 50 74 | 72 3b 0d 09 74 79 70 65 |alProcPt|r;..type| |00002830| 64 65 66 20 70 61 73 63 | 61 6c 20 76 6f 69 64 20 |def pasc|al void | |00002840| 28 2a 52 65 67 69 73 74 | 65 72 36 38 6b 50 72 6f |(*Regist|er68kPro| |00002850| 63 50 74 72 29 28 76 6f | 69 64 29 3b 0d 09 74 79 |cPtr)(vo|id);..ty| |00002860| 70 65 64 65 66 20 52 65 | 67 69 73 74 65 72 36 38 |pedef Re|gister68| |00002870| 6b 50 72 6f 63 50 74 72 | 20 56 42 4c 55 50 50 3b |kProcPtr| VBLUPP;| |00002880| 0d 09 23 64 65 66 69 6e | 65 20 4e 65 77 56 42 4c |..#defin|e NewVBL| |00002890| 50 72 6f 63 28 75 73 65 | 72 52 6f 75 74 69 6e 65 |Proc(use|rRoutine| |000028a0| 29 20 28 28 56 42 4c 55 | 50 50 29 28 75 73 65 72 |) ((VBLU|PP)(user| |000028b0| 52 6f 75 74 69 6e 65 29 | 29 0d 09 23 64 65 66 69 |Routine)|)..#defi| |000028c0| 6e 65 20 44 69 73 70 6f | 73 65 52 6f 75 74 69 6e |ne Dispo|seRoutin| |000028d0| 65 44 65 73 63 72 69 70 | 74 6f 72 28 75 73 65 72 |eDescrip|tor(user| |000028e0| 52 6f 75 74 69 6e 65 29 | 20 28 29 0d 23 65 6e 64 |Routine)| ().#end| |000028f0| 69 66 0d 23 69 66 20 47 | 45 4e 45 52 41 54 49 4e |if.#if G|ENERATIN| |00002900| 47 50 4f 57 45 52 50 43 | 0d 09 76 6f 69 64 20 56 |GPOWERPC|..void V| |00002910| 42 4c 49 6e 74 65 72 72 | 75 70 74 53 65 72 76 69 |BLInterr|uptServi| |00002920| 63 65 52 6f 75 74 69 6e | 65 28 72 65 67 69 73 74 |ceRoutin|e(regist| |00002930| 65 72 20 56 42 4c 54 61 | 73 6b 41 6e 64 41 35 20 |er VBLTa|skAndA5 | |00002940| 2a 76 62 6c 44 61 74 61 | 29 3b 0d 23 65 6c 73 65 |*vblData|);.#else| |00002950| 0d 09 76 6f 69 64 20 56 | 42 4c 49 6e 74 65 72 72 |..void V|BLInterr| |00002960| 75 70 74 53 65 72 76 69 | 63 65 52 6f 75 74 69 6e |uptServi|ceRoutin| |00002970| 65 28 76 6f 69 64 29 3b | 0d 23 65 6e 64 69 66 0d |e(void);|.#endif.| |00002980| 73 74 61 74 69 63 20 76 | 6f 69 64 20 46 72 61 6d |static v|oid Fram| |00002990| 65 53 75 62 72 6f 75 74 | 69 6e 65 28 56 42 4c 54 |eSubrout|ine(VBLT| |000029a0| 61 73 6b 41 6e 64 41 35 | 20 2a 76 62 6c 44 61 74 |askAndA5| *vblDat| |000029b0| 61 29 3b 0d 0d 2f 2a 20 | 54 68 69 73 20 69 73 20 |a);../* |This is | |000029c0| 6a 75 73 74 20 66 6f 72 | 20 72 65 66 65 72 65 6e |just for| referen| |000029d0| 63 65 2e 20 54 68 65 20 | 6f 72 69 67 69 6e 61 6c |ce. The |original| |000029e0| 20 69 73 20 69 6e 20 56 | 69 64 65 6f 54 6f 6f 6c | is in V|ideoTool| |000029f0| 62 6f 78 2e 68 0d 73 74 | 72 75 63 74 20 56 42 4c |box.h.st|ruct VBL| |00002a00| 54 61 73 6b 41 6e 64 41 | 35 20 7b 0d 20 20 20 20 |TaskAndA|5 {. | |00002a10| 76 6f 6c 61 74 69 6c 65 | 20 56 42 4c 54 61 73 6b |volatile| VBLTask| |00002a20| 20 76 62 6c 3b 0d 20 20 | 20 20 6c 6f 6e 67 20 6f | vbl;. | long o| |00002a30| 75 72 41 35 3b 0d 09 23 | 69 66 20 47 45 4e 45 52 |urA5;..#|if GENER| |00002a40| 41 54 49 4e 47 43 46 4d | 0d 09 20 20 20 20 55 6e |ATINGCFM|.. Un| |00002a50| 69 76 65 72 73 61 6c 50 | 72 6f 63 50 74 72 20 73 |iversalP|rocPtr s| |00002a60| 75 62 72 6f 75 74 69 6e | 65 3b 0d 09 23 65 6c 73 |ubroutin|e;..#els| |00002a70| 65 0d 09 20 20 20 20 76 | 6f 69 64 20 28 2a 73 75 |e.. v|oid (*su| |00002a80| 62 72 6f 75 74 69 6e 65 | 29 28 73 74 72 75 63 74 |broutine|)(struct| |00002a90| 20 56 42 4c 54 61 73 6b | 41 6e 64 41 35 20 2a 76 | VBLTask|AndA5 *v| |00002aa0| 62 6c 44 61 74 61 29 3b | 0d 09 23 65 6e 64 69 66 |blData);|..#endif| |00002ab0| 0d 20 20 20 20 47 44 48 | 61 6e 64 6c 65 20 64 65 |. GDH|andle de| |00002ac0| 76 69 63 65 3b 0d 20 20 | 20 20 6c 6f 6e 67 20 73 |vice;. | long s| |00002ad0| 6c 6f 74 3b 0d 20 20 20 | 20 76 6f 6c 61 74 69 6c |lot;. | volatil| |00002ae0| 65 20 6c 6f 6e 67 20 6e | 65 77 46 72 61 6d 65 3b |e long n|ewFrame;| |00002af0| 09 09 09 09 2f 2f 20 42 | 6f 6f 6c 65 61 6e 0d 20 |....// B|oolean. | |00002b00| 20 20 20 76 6f 6c 61 74 | 69 6c 65 20 6c 6f 6e 67 | volat|ile long| |00002b10| 20 66 72 61 6d 65 3b 09 | 09 09 09 2f 2f 20 63 6f | frame;.|...// co| |00002b20| 75 6e 74 20 75 70 20 66 | 72 6f 6d 20 7a 65 72 6f |unt up f|rom zero| |00002b30| 0d 20 20 20 20 76 6f 6c | 61 74 69 6c 65 20 6c 6f |. vol|atile lo| |00002b40| 6e 67 20 66 72 61 6d 65 | 73 4c 65 66 74 3b 09 09 |ng frame|sLeft;..| |00002b50| 09 2f 2f 20 63 6f 75 6e | 74 20 64 6f 77 6e 20 74 |.// coun|t down t| |00002b60| 6f 20 7a 65 72 6f 0d 20 | 20 20 20 6c 6f 6e 67 20 |o zero. | long | |00002b70| 66 72 61 6d 65 73 44 65 | 73 69 72 65 64 3b 0d 20 |framesDe|sired;. | |00002b80| 20 20 20 54 69 6d 65 72 | 20 2a 66 72 61 6d 65 54 | Timer| *frameT| |00002b90| 69 6d 65 72 3b 09 09 09 | 09 09 2f 2f 20 74 69 6d |imer;...|..// tim| |00002ba0| 65 20 6d 73 20 73 69 6e | 63 65 20 6c 61 73 74 20 |e ms sin|ce last | |00002bb0| 56 42 4c 20 69 6e 74 65 | 72 72 75 70 74 2c 20 73 |VBL inte|rrupt, s| |00002bc0| 65 65 20 54 69 6d 65 72 | 2e 63 0d 20 20 20 20 76 |ee Timer|.c. v| |00002bd0| 6f 69 64 20 2a 70 74 72 | 3b 09 09 09 09 09 09 09 |oid *ptr|;.......| |00002be0| 2f 2f 20 75 73 65 20 74 | 68 69 73 20 66 6f 72 20 |// use t|his for | |00002bf0| 77 68 61 74 65 76 65 72 | 20 79 6f 75 20 77 61 6e |whatever| you wan| |00002c00| 74 0d 7d 3b 0d 74 79 70 | 65 64 65 66 20 73 74 72 |t.};.typ|edef str| |00002c10| 75 63 74 20 56 42 4c 54 | 61 73 6b 41 6e 64 41 35 |uct VBLT|askAndA5| |00002c20| 20 56 42 4c 54 61 73 6b | 41 6e 64 41 35 3b 0d 2a | VBLTask|AndA5;.*| |00002c30| 2f 0d 23 64 65 66 69 6e | 65 20 54 41 53 4b 5f 53 |/.#defin|e TASK_S| |00002c40| 49 5a 45 20 31 30 30 30 | 09 2f 2f 20 47 65 6e 65 |IZE 1000|.// Gene| |00002c50| 72 6f 75 73 20 67 75 65 | 73 73 20 66 6f 72 20 73 |rous gue|ss for s| |00002c60| 69 7a 65 20 6f 66 20 72 | 6f 75 74 69 6e 65 0d 73 |ize of r|outine.s| |00002c70| 74 61 74 69 63 20 6c 6f | 6e 67 20 76 6d 50 72 65 |tatic lo|ng vmPre| |00002c80| 73 65 6e 74 3d 30 3b 0d | 73 74 61 74 69 63 20 56 |sent=0;.|static V| |00002c90| 42 4c 55 50 50 20 76 62 | 6c 50 72 6f 63 50 74 72 |BLUPP vb|lProcPtr| |00002ca0| 2c 66 72 61 6d 65 53 75 | 62 72 6f 75 74 69 6e 65 |,frameSu|broutine| |00002cb0| 50 72 6f 63 50 74 72 2c | 73 69 6d 70 6c 65 56 42 |ProcPtr,|simpleVB| |00002cc0| 4c 53 75 62 72 6f 75 74 | 69 6e 65 50 72 6f 63 50 |LSubrout|ineProcP| |00002cd0| 74 72 3b 0d 0d 4f 53 45 | 72 72 20 56 42 4c 49 6e |tr;..OSE|rr VBLIn| |00002ce0| 73 74 61 6c 6c 28 56 42 | 4c 54 61 73 6b 41 6e 64 |stall(VB|LTaskAnd| |00002cf0| 41 35 20 2a 76 62 6c 44 | 61 74 61 2c 47 44 48 61 |A5 *vblD|ata,GDHa| |00002d00| 6e 64 6c 65 20 64 65 76 | 69 63 65 2c 6c 6f 6e 67 |ndle dev|ice,long| |00002d10| 20 66 72 61 6d 65 73 29 | 0d 2f 2f 20 74 72 69 76 | frames)|.// triv| |00002d20| 69 61 6c 2c 20 62 75 74 | 20 76 65 72 62 6f 73 65 |ial, but| verbose| |00002d30| 0d 7b 0d 09 73 74 61 74 | 69 63 20 69 6e 74 20 66 |.{..stat|ic int f| |00002d40| 69 72 73 74 54 69 6d 65 | 3d 31 2c 73 6c 6f 74 52 |irstTime|=1,slotR| |00002d50| 6f 75 74 69 6e 65 73 41 | 76 61 69 6c 61 62 6c 65 |outinesA|vailable| |00002d60| 3b 0d 09 73 74 61 74 69 | 63 20 6c 6f 6e 67 20 74 |;..stati|c long t| |00002d70| 69 6d 65 4d 61 6e 61 67 | 65 72 56 65 72 73 69 6f |imeManag|erVersio| |00002d80| 6e 3d 30 3b 0d 09 0d 09 | 69 66 28 66 69 72 73 74 |n=0;....|if(first| |00002d90| 54 69 6d 65 29 7b 0d 09 | 09 66 69 72 73 74 54 69 |Time){..|.firstTi| |00002da0| 6d 65 3d 30 3b 0d 09 09 | 73 6c 6f 74 52 6f 75 74 |me=0;...|slotRout| |00002db0| 69 6e 65 73 41 76 61 69 | 6c 61 62 6c 65 3d 54 72 |inesAvai|lable=Tr| |00002dc0| 61 70 41 76 61 69 6c 61 | 62 6c 65 28 5f 53 6c 6f |apAvaila|ble(_Slo| |00002dd0| 74 56 49 6e 73 74 61 6c | 6c 29 3b 0d 09 09 47 65 |tVInstal|l);...Ge| |00002de0| 73 74 61 6c 74 28 67 65 | 73 74 61 6c 74 56 4d 41 |stalt(ge|staltVMA| |00002df0| 74 74 72 2c 26 76 6d 50 | 72 65 73 65 6e 74 29 3b |ttr,&vmP|resent);| |00002e00| 0d 09 09 76 6d 50 72 65 | 73 65 6e 74 20 26 3d 20 |...vmPre|sent &= | |00002e10| 31 4c 3c 3c 67 65 73 74 | 61 6c 74 56 4d 50 72 65 |1L<<gest|altVMPre| |00002e20| 73 65 6e 74 3b 0d 09 09 | 41 74 45 78 69 74 54 6f |sent;...|AtExitTo| |00002e30| 53 68 65 6c 6c 28 56 42 | 4c 52 65 6d 6f 76 65 41 |Shell(VB|LRemoveA| |00002e40| 6c 6c 29 3b 0d 09 09 47 | 65 73 74 61 6c 74 28 67 |ll);...G|estalt(g| |00002e50| 65 73 74 61 6c 74 54 69 | 6d 65 4d 67 72 56 65 72 |estaltTi|meMgrVer| |00002e60| 73 69 6f 6e 2c 26 74 69 | 6d 65 4d 61 6e 61 67 65 |sion,&ti|meManage| |00002e70| 72 56 65 72 73 69 6f 6e | 29 3b 0d 09 09 76 62 6c |rVersion|);...vbl| |00002e80| 50 72 6f 63 50 74 72 3d | 4e 65 77 56 42 4c 50 72 |ProcPtr=|NewVBLPr| |00002e90| 6f 63 28 56 42 4c 49 6e | 74 65 72 72 75 70 74 53 |oc(VBLIn|terruptS| |00002ea0| 65 72 76 69 63 65 52 6f | 75 74 69 6e 65 29 3b 0d |erviceRo|utine);.| |00002eb0| 09 09 66 72 61 6d 65 53 | 75 62 72 6f 75 74 69 6e |..frameS|ubroutin| |00002ec0| 65 50 72 6f 63 50 74 72 | 3d 4e 65 77 56 42 4c 50 |eProcPtr|=NewVBLP| |00002ed0| 72 6f 63 28 46 72 61 6d | 65 53 75 62 72 6f 75 74 |roc(Fram|eSubrout| |00002ee0| 69 6e 65 29 3b 0d 09 09 | 73 69 6d 70 6c 65 56 42 |ine);...|simpleVB| |00002ef0| 4c 53 75 62 72 6f 75 74 | 69 6e 65 50 72 6f 63 50 |LSubrout|ineProcP| |00002f00| 74 72 3d 4e 65 77 56 42 | 4c 50 72 6f 63 28 53 69 |tr=NewVB|LProc(Si| |00002f10| 6d 70 6c 65 56 42 4c 53 | 75 62 72 6f 75 74 69 6e |mpleVBLS|ubroutin| |00002f20| 65 29 3b 0d 09 7d 0d 09 | 76 62 6c 44 61 74 61 2d |e);..}..|vblData-| |00002f30| 3e 64 65 76 69 63 65 3d | 64 65 76 69 63 65 3b 0d |>device=|device;.| |00002f40| 09 69 66 28 64 65 76 69 | 63 65 21 3d 4e 55 4c 4c |.if(devi|ce!=NULL| |00002f50| 20 26 26 20 28 2a 64 65 | 76 69 63 65 29 2d 3e 67 | && (*de|vice)->g| |00002f60| 64 52 65 66 4e 75 6d 21 | 3d 30 20 26 26 20 73 6c |dRefNum!|=0 && sl| |00002f70| 6f 74 52 6f 75 74 69 6e | 65 73 41 76 61 69 6c 61 |otRoutin|esAvaila| |00002f80| 62 6c 65 29 0d 09 09 76 | 62 6c 44 61 74 61 2d 3e |ble)...v|blData->| |00002f90| 73 6c 6f 74 3d 47 65 74 | 44 65 76 69 63 65 53 6c |slot=Get|DeviceSl| |00002fa0| 6f 74 28 64 65 76 69 63 | 65 29 3b 0d 09 65 6c 73 |ot(devic|e);..els| |00002fb0| 65 20 76 62 6c 44 61 74 | 61 2d 3e 73 6c 6f 74 3d |e vblDat|a->slot=| |00002fc0| 2d 31 3b 0d 09 76 62 6c | 44 61 74 61 2d 3e 76 62 |-1;..vbl|Data->vb| |00002fd0| 6c 2e 76 62 6c 41 64 64 | 72 3d 28 76 6f 69 64 20 |l.vblAdd|r=(void | |00002fe0| 2a 29 76 62 6c 50 72 6f | 63 50 74 72 3b 0d 09 76 |*)vblPro|cPtr;..v| |00002ff0| 62 6c 44 61 74 61 2d 3e | 76 62 6c 2e 71 54 79 70 |blData->|vbl.qTyp| |00003000| 65 3d 76 54 79 70 65 3b | 0d 09 76 62 6c 44 61 74 |e=vType;|..vblDat| |00003010| 61 2d 3e 76 62 6c 2e 76 | 62 6c 43 6f 75 6e 74 3d |a->vbl.v|blCount=| |00003020| 30 3b 09 2f 2a 20 49 6e | 69 74 69 61 6c 6c 79 20 |0;./* In|itially | |00003030| 64 69 73 61 62 6c 65 20 | 74 68 65 20 69 6e 74 65 |disable |the inte| |00003040| 72 72 75 70 74 20 73 65 | 72 76 69 63 65 20 72 6f |rrupt se|rvice ro| |00003050| 75 74 69 6e 65 20 2a 2f | 0d 09 76 62 6c 44 61 74 |utine */|..vblDat| |00003060| 61 2d 3e 76 62 6c 2e 76 | 62 6c 50 68 61 73 65 3d |a->vbl.v|blPhase=| |00003070| 30 3b 0d 09 76 62 6c 44 | 61 74 61 2d 3e 6f 75 72 |0;..vblD|ata->our| |00003080| 41 35 3d 53 65 74 43 75 | 72 72 65 6e 74 41 35 28 |A5=SetCu|rrentA5(| |00003090| 29 3b 0d 09 69 66 28 76 | 62 6c 44 61 74 61 2d 3e |);..if(v|blData->| |000030a0| 73 75 62 72 6f 75 74 69 | 6e 65 3d 3d 4e 55 4c 4c |subrouti|ne==NULL| |000030b0| 29 7b 0d 09 09 69 66 28 | 74 69 6d 65 4d 61 6e 61 |){...if(|timeMana| |000030c0| 67 65 72 56 65 72 73 69 | 6f 6e 3e 3d 67 65 73 74 |gerVersi|on>=gest| |000030d0| 61 6c 74 52 65 76 69 73 | 65 64 54 69 6d 65 4d 67 |altRevis|edTimeMg| |000030e0| 72 29 7b 0d 09 09 09 76 | 62 6c 44 61 74 61 2d 3e |r){....v|blData->| |000030f0| 66 72 61 6d 65 54 69 6d | 65 72 3d 4e 65 77 54 69 |frameTim|er=NewTi| |00003100| 6d 65 72 28 29 3b 0d 09 | 09 09 53 74 61 72 74 54 |mer();..|..StartT| |00003110| 69 6d 65 72 28 76 62 6c | 44 61 74 61 2d 3e 66 72 |imer(vbl|Data->fr| |00003120| 61 6d 65 54 69 6d 65 72 | 29 3b 0d 09 09 09 76 62 |ameTimer|);....vb| |00003130| 6c 44 61 74 61 2d 3e 73 | 75 62 72 6f 75 74 69 6e |lData->s|ubroutin| |00003140| 65 3d 28 76 6f 69 64 20 | 2a 29 66 72 61 6d 65 53 |e=(void |*)frameS| |00003150| 75 62 72 6f 75 74 69 6e | 65 50 72 6f 63 50 74 72 |ubroutin|eProcPtr| |00003160| 3b 0d 09 09 7d 0d 09 09 | 65 6c 73 65 20 76 62 6c |;...}...|else vbl| |00003170| 44 61 74 61 2d 3e 73 75 | 62 72 6f 75 74 69 6e 65 |Data->su|broutine| |00003180| 3d 28 76 6f 69 64 20 2a | 29 73 69 6d 70 6c 65 56 |=(void *|)simpleV| |00003190| 42 4c 53 75 62 72 6f 75 | 74 69 6e 65 50 72 6f 63 |BLSubrou|tineProc| |000031a0| 50 74 72 3b 0d 09 7d 0d | 09 76 62 6c 44 61 74 61 |Ptr;..}.|.vblData| |000031b0| 2d 3e 6e 65 77 46 72 61 | 6d 65 3d 30 3b 0d 09 76 |->newFra|me=0;..v| |000031c0| 62 6c 44 61 74 61 2d 3e | 66 72 61 6d 65 3d 30 3b |blData->|frame=0;| |000031d0| 0d 09 76 62 6c 44 61 74 | 61 2d 3e 66 72 61 6d 65 |..vblDat|a->frame| |000031e0| 73 4c 65 66 74 3d 76 62 | 6c 44 61 74 61 2d 3e 66 |sLeft=vb|lData->f| |000031f0| 72 61 6d 65 73 44 65 73 | 69 72 65 64 3d 66 72 61 |ramesDes|ired=fra| |00003200| 6d 65 73 3b 0d 09 69 66 | 28 76 6d 50 72 65 73 65 |mes;..if|(vmPrese| |00003210| 6e 74 29 7b 0d 09 09 48 | 6f 6c 64 4d 65 6d 6f 72 |nt){...H|oldMemor| |00003220| 79 28 76 62 6c 44 61 74 | 61 2c 73 69 7a 65 6f 66 |y(vblDat|a,sizeof| |00003230| 28 2a 76 62 6c 44 61 74 | 61 29 29 3b 0d 09 09 48 |(*vblDat|a));...H| |00003240| 6f 6c 64 4d 65 6d 6f 72 | 79 28 76 62 6c 44 61 74 |oldMemor|y(vblDat| |00003250| 61 2d 3e 76 62 6c 2e 76 | 62 6c 41 64 64 72 2c 54 |a->vbl.v|blAddr,T| |00003260| 41 53 4b 5f 53 49 5a 45 | 29 3b 0d 09 09 48 6f 6c |ASK_SIZE|);...Hol| |00003270| 64 4d 65 6d 6f 72 79 28 | 76 62 6c 44 61 74 61 2d |dMemory(|vblData-| |00003280| 3e 73 75 62 72 6f 75 74 | 69 6e 65 2c 54 41 53 4b |>subrout|ine,TASK| |00003290| 5f 53 49 5a 45 29 3b 0d | 09 7d 0d 09 69 66 28 76 |_SIZE);.|.}..if(v| |000032a0| 62 6c 44 61 74 61 2d 3e | 73 6c 6f 74 3e 3d 30 29 |blData->|slot>=0)| |000032b0| 72 65 74 75 72 6e 20 53 | 6c 6f 74 56 49 6e 73 74 |return S|lotVInst| |000032c0| 61 6c 6c 28 28 51 45 6c | 65 6d 50 74 72 29 76 62 |all((QEl|emPtr)vb| |000032d0| 6c 44 61 74 61 2c 76 62 | 6c 44 61 74 61 2d 3e 73 |lData,vb|lData->s| |000032e0| 6c 6f 74 29 3b 0d 09 65 | 6c 73 65 20 72 65 74 75 |lot);..e|lse retu| |000032f0| 72 6e 20 56 49 6e 73 74 | 61 6c 6c 28 28 51 45 6c |rn VInst|all((QEl| |00003300| 65 6d 50 74 72 29 76 62 | 6c 44 61 74 61 29 3b 0d |emPtr)vb|lData);.| |00003310| 7d 0d 0d 4f 53 45 72 72 | 20 56 42 4c 52 65 6d 6f |}..OSErr| VBLRemo| |00003320| 76 65 28 56 42 4c 54 61 | 73 6b 41 6e 64 41 35 20 |ve(VBLTa|skAndA5 | |00003330| 2a 76 62 6c 44 61 74 61 | 29 0d 7b 0d 20 20 20 20 |*vblData|).{. | |00003340| 69 6e 74 20 65 72 72 6f | 72 3b 0d 0d 09 2f 2f 20 |int erro|r;...// | |00003350| 6f 6e 6c 79 20 72 65 6d | 6f 76 65 20 69 74 20 69 |only rem|ove it i| |00003360| 66 20 77 65 20 69 6e 73 | 74 61 6c 6c 65 64 20 69 |f we ins|talled i| |00003370| 74 0d 09 69 66 28 76 62 | 6c 44 61 74 61 2d 3e 76 |t..if(vb|lData->v| |00003380| 62 6c 2e 76 62 6c 41 64 | 64 72 20 21 3d 20 76 62 |bl.vblAd|dr != vb| |00003390| 6c 50 72 6f 63 50 74 72 | 29 72 65 74 75 72 6e 20 |lProcPtr|)return | |000033a0| 30 3b 0d 09 69 66 28 76 | 62 6c 44 61 74 61 2d 3e |0;..if(v|blData->| |000033b0| 73 6c 6f 74 3e 3d 30 29 | 65 72 72 6f 72 3d 53 6c |slot>=0)|error=Sl| |000033c0| 6f 74 56 52 65 6d 6f 76 | 65 28 28 51 45 6c 65 6d |otVRemov|e((QElem| |000033d0| 50 74 72 29 76 62 6c 44 | 61 74 61 2c 76 62 6c 44 |Ptr)vblD|ata,vblD| |000033e0| 61 74 61 2d 3e 73 6c 6f | 74 29 3b 0d 09 65 6c 73 |ata->slo|t);..els| |000033f0| 65 20 65 72 72 6f 72 3d | 56 52 65 6d 6f 76 65 28 |e error=|VRemove(| |00003400| 28 51 45 6c 65 6d 50 74 | 72 29 76 62 6c 44 61 74 |(QElemPt|r)vblDat| |00003410| 61 29 3b 0d 09 69 66 28 | 76 6d 50 72 65 73 65 6e |a);..if(|vmPresen| |00003420| 74 29 7b 0d 09 09 55 6e | 68 6f 6c 64 4d 65 6d 6f |t){...Un|holdMemo| |00003430| 72 79 28 76 62 6c 44 61 | 74 61 2c 73 69 7a 65 6f |ry(vblDa|ta,sizeo| |00003440| 66 28 76 62 6c 44 61 74 | 61 29 29 3b 0d 09 09 55 |f(vblDat|a));...U| |00003450| 6e 68 6f 6c 64 4d 65 6d | 6f 72 79 28 76 62 6c 44 |nholdMem|ory(vblD| |00003460| 61 74 61 2d 3e 76 62 6c | 2e 76 62 6c 41 64 64 72 |ata->vbl|.vblAddr| |00003470| 2c 54 41 53 4b 5f 53 49 | 5a 45 29 3b 0d 09 09 55 |,TASK_SI|ZE);...U| |00003480| 6e 68 6f 6c 64 4d 65 6d | 6f 72 79 28 76 62 6c 44 |nholdMem|ory(vblD| |00003490| 61 74 61 2d 3e 73 75 62 | 72 6f 75 74 69 6e 65 2c |ata->sub|routine,| |000034a0| 54 41 53 4b 5f 53 49 5a | 45 29 3b 0d 09 7d 0d 09 |TASK_SIZ|E);..}..| |000034b0| 69 66 28 76 62 6c 44 61 | 74 61 2d 3e 73 75 62 72 |if(vblDa|ta->subr| |000034c0| 6f 75 74 69 6e 65 3d 3d | 28 76 6f 69 64 20 2a 29 |outine==|(void *)| |000034d0| 66 72 61 6d 65 53 75 62 | 72 6f 75 74 69 6e 65 50 |frameSub|routineP| |000034e0| 72 6f 63 50 74 72 20 26 | 26 20 76 62 6c 44 61 74 |rocPtr &|& vblDat| |000034f0| 61 2d 3e 66 72 61 6d 65 | 54 69 6d 65 72 21 3d 4e |a->frame|Timer!=N| |00003500| 55 4c 4c 29 0d 09 09 44 | 69 73 70 6f 73 65 54 69 |ULL)...D|isposeTi| |00003510| 6d 65 72 28 76 62 6c 44 | 61 74 61 2d 3e 66 72 61 |mer(vblD|ata->fra| |00003520| 6d 65 54 69 6d 65 72 29 | 3b 0d 09 72 65 74 75 72 |meTimer)|;..retur| |00003530| 6e 20 65 72 72 6f 72 3b | 0d 7d 0d 0d 76 6f 69 64 |n error;|.}..void| |00003540| 20 56 42 4c 52 65 6d 6f | 76 65 41 6c 6c 28 76 6f | VBLRemo|veAll(vo| |00003550| 69 64 29 0d 7b 0d 09 51 | 48 64 72 50 74 72 20 71 |id).{..Q|HdrPtr q| |00003560| 48 65 61 64 65 72 3b 0d | 09 51 45 6c 65 6d 50 74 |Header;.|.QElemPt| |00003570| 72 20 71 3b 0d 09 0d 09 | 71 48 65 61 64 65 72 3d |r q;....|qHeader=| |00003580| 47 65 74 56 42 4c 51 48 | 64 72 28 29 3b 0d 09 71 |GetVBLQH|dr();..q| |00003590| 3d 71 48 65 61 64 65 72 | 2d 3e 71 48 65 61 64 3b |=qHeader|->qHead;| |000035a0| 0d 09 77 68 69 6c 65 28 | 71 21 3d 4e 55 4c 4c 29 |..while(|q!=NULL)| |000035b0| 7b 0d 09 09 56 42 4c 52 | 65 6d 6f 76 65 28 28 56 |{...VBLR|emove((V| |000035c0| 42 4c 54 61 73 6b 41 6e | 64 41 35 20 2a 29 71 29 |BLTaskAn|dA5 *)q)| |000035d0| 3b 09 2f 2f 20 6f 6e 6c | 79 20 72 65 6d 6f 76 65 |;.// onl|y remove| |000035e0| 73 20 6f 75 72 73 0d 09 | 09 71 3d 71 2d 3e 71 4c |s ours..|.q=q->qL| |000035f0| 69 6e 6b 3b 0d 09 7d 0d | 7d 09 0d 0d 23 69 66 20 |ink;..}.|}...#if | |00003600| 28 54 48 49 4e 4b 5f 43 | 20 7c 7c 20 54 48 49 4e |(THINK_C| || THIN| |00003610| 4b 5f 43 50 4c 55 53 20 | 7c 7c 20 53 59 4d 41 4e |K_CPLUS ||| SYMAN| |00003620| 54 45 43 5f 43 29 0d 09 | 23 70 72 61 67 6d 61 20 |TEC_C)..|#pragma | |00003630| 6f 70 74 69 6f 6e 73 28 | 21 70 72 6f 66 69 6c 65 |options(|!profile| |00003640| 29 09 2f 2f 20 69 74 20 | 77 6f 75 6c 64 20 62 65 |).// it |would be| |00003650| 20 64 61 6e 67 65 72 6f | 75 73 20 74 6f 20 63 61 | dangero|us to ca| |00003660| 6c 6c 20 74 68 65 20 70 | 72 6f 66 69 6c 65 72 20 |ll the p|rofiler | |00003670| 66 72 6f 6d 20 68 65 72 | 65 0d 09 23 70 72 61 67 |from her|e..#prag| |00003680| 6d 61 20 6f 70 74 69 6f | 6e 73 28 61 73 73 69 67 |ma optio|ns(assig| |00003690| 6e 5f 72 65 67 69 73 74 | 65 72 73 2c 72 65 64 75 |n_regist|ers,redu| |000036a0| 6e 64 61 6e 74 5f 6c 6f | 61 64 73 29 0d 23 65 6e |ndant_lo|ads).#en| |000036b0| 64 69 66 0d 23 69 66 20 | 5f 5f 4d 57 45 52 4b 53 |dif.#if |__MWERKS| |000036c0| 5f 5f 20 26 26 20 5f 5f | 70 72 6f 66 69 6c 65 5f |__ && __|profile_| |000036d0| 5f 0d 09 23 70 72 61 67 | 6d 61 20 70 72 6f 66 69 |_..#prag|ma profi| |000036e0| 6c 65 20 6f 66 66 09 09 | 09 2f 2f 20 6f 6e 20 36 |le off..|.// on 6| |000036f0| 38 6b 20 69 74 20 77 6f | 75 6c 64 20 62 65 20 64 |8k it wo|uld be d| |00003700| 61 6e 67 65 72 6f 75 73 | 20 74 6f 20 63 61 6c 6c |angerous| to call| |00003710| 20 74 68 65 20 70 72 6f | 66 69 6c 65 72 20 66 72 | the pro|filer fr| |00003720| 6f 6d 20 68 65 72 65 0d | 23 65 6e 64 69 66 0d 0d |om here.|#endif..| |00003730| 23 69 66 20 47 45 4e 45 | 52 41 54 49 4e 47 50 4f |#if GENE|RATINGPO| |00003740| 57 45 52 50 43 0d 09 76 | 6f 69 64 20 56 42 4c 49 |WERPC..v|oid VBLI| |00003750| 6e 74 65 72 72 75 70 74 | 53 65 72 76 69 63 65 52 |nterrupt|ServiceR| |00003760| 6f 75 74 69 6e 65 28 72 | 65 67 69 73 74 65 72 20 |outine(r|egister | |00003770| 56 42 4c 54 61 73 6b 41 | 6e 64 41 35 20 2a 76 62 |VBLTaskA|ndA5 *vb| |00003780| 6c 44 61 74 61 29 0d 09 | 7b 0d 09 09 43 61 6c 6c |lData)..|{...Call| |00003790| 56 42 4c 50 72 6f 63 28 | 76 62 6c 44 61 74 61 2d |VBLProc(|vblData-| |000037a0| 3e 73 75 62 72 6f 75 74 | 69 6e 65 2c 76 62 6c 44 |>subrout|ine,vblD| |000037b0| 61 74 61 29 3b 09 2f 2f | 20 63 61 6c 6c 20 75 73 |ata);.//| call us| |000037c0| 65 72 27 73 20 74 61 73 | 6b 2c 20 70 61 73 73 20 |er's tas|k, pass | |000037d0| 64 61 74 61 20 70 74 72 | 0d 09 7d 0d 23 65 6c 73 |data ptr|..}.#els| |000037e0| 65 0d 09 23 70 72 61 67 | 6d 61 20 70 61 72 61 6d |e..#prag|ma param| |000037f0| 65 74 65 72 20 5f 5f 44 | 30 20 47 65 74 41 30 0d |eter __D|0 GetA0.| |00003800| 09 6c 6f 6e 67 20 47 65 | 74 41 30 28 76 6f 69 64 |.long Ge|tA0(void| |00003810| 29 3d 30 78 32 30 30 38 | 3b 09 09 2f 2a 20 4d 4f |)=0x2008|;../* MO| |00003820| 56 45 2e 4c 20 41 30 2c | 44 30 20 2a 2f 0d 2f 2f |VE.L A0,|D0 */.//| |00003830| 09 50 74 72 20 47 65 74 | 41 30 28 76 6f 69 64 29 |.Ptr Get|A0(void)| |00003840| 3a 5f 5f 44 30 20 3d 30 | 78 32 30 30 38 3b 09 2f |:__D0 =0|x2008;./| |00003850| 2a 20 4d 4f 56 45 2e 4c | 20 41 30 2c 44 30 20 2a |* MOVE.L| A0,D0 *| |00003860| 2f 0d 0d 09 76 6f 69 64 | 20 56 42 4c 49 6e 74 65 |/...void| VBLInte| |00003870| 72 72 75 70 74 53 65 72 | 76 69 63 65 52 6f 75 74 |rruptSer|viceRout| |00003880| 69 6e 65 28 76 6f 69 64 | 29 0d 09 7b 0d 09 09 72 |ine(void|)..{...r| |00003890| 65 67 69 73 74 65 72 20 | 6c 6f 6e 67 20 6f 6c 64 |egister |long old| |000038a0| 41 35 3b 0d 09 09 72 65 | 67 69 73 74 65 72 20 56 |A5;...re|gister V| |000038b0| 42 4c 54 61 73 6b 41 6e | 64 41 35 20 2a 76 62 6c |BLTaskAn|dA5 *vbl| |000038c0| 44 61 74 61 3b 0d 09 0d | 09 09 76 62 6c 44 61 74 |Data;...|..vblDat| |000038d0| 61 20 3d 20 28 56 42 4c | 54 61 73 6b 41 6e 64 41 |a = (VBL|TaskAndA| |000038e0| 35 20 2a 29 47 65 74 41 | 30 28 29 3b 0d 09 09 6f |5 *)GetA|0();...o| |000038f0| 6c 64 41 35 20 3d 20 53 | 65 74 41 35 28 76 62 6c |ldA5 = S|etA5(vbl| |00003900| 44 61 74 61 2d 3e 6f 75 | 72 41 35 29 3b 0d 09 09 |Data->ou|rA5);...| |00003910| 2f 2f 20 63 61 6c 6c 20 | 75 73 65 72 27 73 20 74 |// call |user's t| |00003920| 61 73 6b 2c 20 70 61 73 | 73 20 64 61 74 61 20 70 |ask, pas|s data p| |00003930| 74 72 0d 09 09 23 69 66 | 20 47 45 4e 45 52 41 54 |tr...#if| GENERAT| |00003940| 49 4e 47 43 46 4d 0d 09 | 09 09 2f 2f 20 57 41 52 |INGCFM..|..// WAR| |00003950| 4e 49 4e 47 3a 20 75 70 | 70 56 42 4c 50 72 6f 63 |NING: up|pVBLProc| |00003960| 49 6e 66 6f 20 69 73 20 | 74 68 65 20 77 72 6f 6e |Info is |the wron| |00003970| 67 20 73 65 6c 65 63 74 | 6f 72 2e 0d 09 09 09 43 |g select|or.....C| |00003980| 61 6c 6c 55 6e 69 76 65 | 72 73 61 6c 50 72 6f 63 |allUnive|rsalProc| |00003990| 28 76 62 6c 44 61 74 61 | 2d 3e 73 75 62 72 6f 75 |(vblData|->subrou| |000039a0| 74 69 6e 65 2c 75 70 70 | 56 42 4c 50 72 6f 63 49 |tine,upp|VBLProcI| |000039b0| 6e 66 6f 2c 76 62 6c 44 | 61 74 61 29 3b 0d 09 09 |nfo,vblD|ata);...| |000039c0| 23 65 6c 73 65 0d 09 09 | 09 28 2a 76 62 6c 44 61 |#else...|.(*vblDa| |000039d0| 74 61 2d 3e 73 75 62 72 | 6f 75 74 69 6e 65 29 28 |ta->subr|outine)(| |000039e0| 76 62 6c 44 61 74 61 29 | 3b 0d 09 09 23 65 6e 64 |vblData)|;...#end| |000039f0| 69 66 0d 09 09 53 65 74 | 41 35 28 6f 6c 64 41 35 |if...Set|A5(oldA5| |00003a00| 29 3b 0d 09 7d 0d 23 65 | 6e 64 69 66 0d 0d 76 6f |);..}.#e|ndif..vo| |00003a10| 69 64 20 53 69 6d 70 6c | 65 56 42 4c 53 75 62 72 |id Simpl|eVBLSubr| |00003a20| 6f 75 74 69 6e 65 28 56 | 42 4c 54 61 73 6b 41 6e |outine(V|BLTaskAn| |00003a30| 64 41 35 20 2a 76 62 6c | 44 61 74 61 29 0d 7b 0d |dA5 *vbl|Data).{.| |00003a40| 09 76 62 6c 44 61 74 61 | 2d 3e 6e 65 77 46 72 61 |.vblData|->newFra| |00003a50| 6d 65 3d 31 3b 0d 09 76 | 62 6c 44 61 74 61 2d 3e |me=1;..v|blData->| |00003a60| 66 72 61 6d 65 2b 2b 3b | 0d 09 69 66 28 76 62 6c |frame++;|..if(vbl| |00003a70| 44 61 74 61 2d 3e 66 72 | 61 6d 65 73 4c 65 66 74 |Data->fr|amesLeft| |00003a80| 3e 30 29 76 62 6c 44 61 | 74 61 2d 3e 66 72 61 6d |>0)vblDa|ta->fram| |00003a90| 65 73 4c 65 66 74 2d 2d | 3b 0d 09 69 66 28 76 62 |esLeft--|;..if(vb| |00003aa0| 6c 44 61 74 61 2d 3e 66 | 72 61 6d 65 73 4c 65 66 |lData->f|ramesLef| |00003ab0| 74 21 3d 30 29 76 62 6c | 44 61 74 61 2d 3e 76 62 |t!=0)vbl|Data->vb| |00003ac0| 6c 2e 76 62 6c 43 6f 75 | 6e 74 3d 31 3b 0d 7d 0d |l.vblCou|nt=1;.}.| |00003ad0| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 20 46 72 61 |.static |void Fra| |00003ae0| 6d 65 53 75 62 72 6f 75 | 74 69 6e 65 28 56 42 4c |meSubrou|tine(VBL| |00003af0| 54 61 73 6b 41 6e 64 41 | 35 20 2a 76 62 6c 44 61 |TaskAndA|5 *vblDa| |00003b00| 74 61 29 0d 7b 0d 09 2f | 2f 20 54 68 65 20 31 39 |ta).{../|/ The 19| |00003b10| 39 31 2d 32 20 41 70 70 | 6c 65 20 76 69 64 65 6f |91-2 App|le video| |00003b20| 20 63 61 72 64 73 20 65 | 6d 69 74 20 73 65 76 65 | cards e|mit seve| |00003b30| 72 61 6c 20 76 62 6c 20 | 69 6e 74 65 72 72 75 70 |ral vbl |interrup| |00003b40| 74 73 20 70 65 72 20 66 | 72 61 6d 65 2c 0d 09 2f |ts per f|rame,../| |00003b50| 2f 20 77 68 69 63 68 20 | 76 69 6f 6c 61 74 65 73 |/ which |violates| |00003b60| 20 41 70 70 6c 65 27 73 | 20 64 6f 63 75 6d 65 6e | Apple's| documen| |00003b70| 74 61 74 69 6f 6e 2e 0d | 09 2f 2f 20 53 6f 20 77 |tation..|.// So w| |00003b80| 65 20 75 73 65 20 74 68 | 65 20 54 69 6d 65 20 4d |e use th|e Time M| |00003b90| 61 6e 61 67 65 72 20 74 | 6f 20 69 67 6e 6f 72 65 |anager t|o ignore| |00003ba0| 20 61 6e 79 20 69 6e 74 | 65 72 72 75 70 74 20 74 | any int|errupt t| |00003bb0| 68 61 74 20 6f 63 63 75 | 72 73 20 77 69 74 68 69 |hat occu|rs withi| |00003bc0| 6e 20 35 20 6d 73 0d 09 | 2f 2f 20 6f 66 20 74 68 |n 5 ms..|// of th| |00003bd0| 65 20 6d 6f 73 74 20 72 | 65 63 65 6e 74 20 69 6e |e most r|ecent in| |00003be0| 74 65 72 72 75 70 74 2c | 20 66 6f 72 20 74 68 61 |terrupt,| for tha| |00003bf0| 74 20 76 69 64 65 6f 20 | 64 65 76 69 63 65 2e 0d |t video |device..| |00003c00| 09 2f 2f 20 54 68 75 73 | 20 74 68 69 73 20 66 72 |.// Thus| this fr| |00003c10| 61 6d 65 20 63 6f 75 6e | 74 65 72 20 73 68 6f 75 |ame coun|ter shou| |00003c20| 6c 64 20 77 6f 72 6b 20 | 63 6f 72 72 65 63 74 6c |ld work |correctl| |00003c30| 79 20 6f 6e 20 61 6c 6c | 20 76 69 64 65 6f 20 63 |y on all| video c| |00003c40| 61 72 64 73 2e 0d 09 2f | 2f 20 53 75 67 67 65 73 |ards.../|/ Sugges| |00003c50| 74 65 64 20 62 79 20 52 | 61 79 6e 61 6c 64 20 43 |ted by R|aynald C| |00003c60| 6f 6d 74 6f 69 73 2e 0d | 09 69 66 28 53 74 6f 70 |omtois..|.if(Stop| |00003c70| 54 69 6d 65 72 28 76 62 | 6c 44 61 74 61 2d 3e 66 |Timer(vb|lData->f| |00003c80| 72 61 6d 65 54 69 6d 65 | 72 29 3e 35 30 30 30 29 |rameTime|r)>5000)| |00003c90| 7b 0d 09 09 76 62 6c 44 | 61 74 61 2d 3e 6e 65 77 |{...vblD|ata->new| |00003ca0| 46 72 61 6d 65 3d 31 3b | 09 09 09 09 09 09 09 09 |Frame=1;|........| |00003cb0| 09 2f 2f 20 73 65 74 20 | 6e 65 77 2d 66 72 61 6d |.// set |new-fram| |00003cc0| 65 20 66 6c 61 67 0d 09 | 09 76 62 6c 44 61 74 61 |e flag..|.vblData| |00003cd0| 2d 3e 66 72 61 6d 65 2b | 2b 3b 0d 09 09 69 66 28 |->frame+|+;...if(| |00003ce0| 76 62 6c 44 61 74 61 2d | 3e 66 72 61 6d 65 73 4c |vblData-|>framesL| |00003cf0| 65 66 74 3e 30 29 76 62 | 6c 44 61 74 61 2d 3e 66 |eft>0)vb|lData->f| |00003d00| 72 61 6d 65 73 4c 65 66 | 74 2d 2d 3b 0d 09 09 69 |ramesLef|t--;...i| |00003d10| 66 28 76 62 6c 44 61 74 | 61 2d 3e 66 72 61 6d 65 |f(vblDat|a->frame| |00003d20| 73 4c 65 66 74 21 3d 30 | 29 76 62 6c 44 61 74 61 |sLeft!=0|)vblData| |00003d30| 2d 3e 76 62 6c 2e 76 62 | 6c 43 6f 75 6e 74 3d 31 |->vbl.vb|lCount=1| |00003d40| 3b 09 09 2f 2f 20 72 65 | 2d 65 6e 61 62 6c 65 20 |;..// re|-enable | |00003d50| 69 6e 74 65 72 72 75 70 | 74 0d 09 7d 65 6c 73 65 |interrup|t..}else| |00003d60| 20 76 62 6c 44 61 74 61 | 2d 3e 76 62 6c 2e 76 62 | vblData|->vbl.vb| |00003d70| 6c 43 6f 75 6e 74 3d 31 | 3b 09 09 09 09 09 09 09 |lCount=1|;.......| |00003d80| 09 2f 2f 20 72 65 2d 65 | 6e 61 62 6c 65 20 69 6e |.// re-e|nable in| |00003d90| 74 65 72 72 75 70 74 0d | 09 53 74 61 72 74 54 69 |terrupt.|.StartTi| |00003da0| 6d 65 72 28 76 62 6c 44 | 61 74 61 2d 3e 66 72 61 |mer(vblD|ata->fra| |00003db0| 6d 65 54 69 6d 65 72 29 | 3b 0d 7d 0d 00 00 00 00 |meTimer)|;.}.....| |00003dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00003dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00003de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00003df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00003e00| 00 00 01 00 00 00 02 ce | 00 00 01 ce 00 00 00 86 |........|........| |00003e10| 00 00 02 13 1c 42 4e 6f | 6e 2d 43 6f 6c 6c 65 67 |.....BNo|n-Colleg| |00003e20| 65 20 57 6f 72 6b 20 53 | 74 75 64 79 20 4a 6f 62 |e Work S|tudy Job| |00003e30| 0c 56 42 4c 49 6e 73 74 | 61 6c 6c 2e 63 74 02 00 |.VBLInst|all.ct..| |00003e40| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 50 06 00 |..TEXTCW|IE...P..| |00003e50| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 50 06 00 |..TEXTCW|IE...P..| |00003e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00003e70| 00 00 ab b0 d0 18 00 00 | 3d 3c 00 00 03 54 00 01 |........|=<...T..| |00003e80| 00 00 00 00 00 00 00 00 | 48 57 00 00 00 00 00 00 |........|HW......| |00003e90| 00 00 00 00 00 00 00 00 | 0b 00 00 00 02 13 05 42 |........|.......B| |00003ea0| 4e 6f 6e 65 02 00 00 00 | 4d 41 49 4c 43 45 44 41 |None....|MAILCEDA| |00003eb0| 00 00 00 00 00 00 00 00 | 00 00 02 3d 00 00 00 00 |........|...=....| |00003ec0| 09 84 00 00 10 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00003ed0| a3 52 0b f4 a3 52 0b f4 | 00 00 00 00 00 00 00 00 |.R...R..|........| |00003ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 48 55 |........|......HU| |00003ef0| 00 02 00 00 00 00 00 00 | 00 00 48 55 00 00 00 00 |........|..HU....| |00003f00| 00 00 00 88 00 04 00 24 | 00 00 2b 00 00 d2 00 50 |.......$|..+....P| |00003f10| 42 b4 00 00 15 73 6c 6f | 74 52 6f 75 74 69 6e 65 |B....slo|tRoutine| |00003f20| 73 41 76 61 69 6c 61 62 | 6c 65 00 24 00 00 2b 00 |sAvailab|le.$..+.| |00003f30| 00 d2 00 50 42 a4 00 00 | 15 73 6c 6f 74 52 6f 75 |...PB...|.slotRou| |00003f40| 74 69 6e 65 73 41 76 61 | 69 6c 61 62 6c 65 00 28 |tinesAva|ilable.(| |00003f50| 00 00 2f 2c 00 f2 00 50 | 42 94 80 00 00 47 01 4d |../,...P|B....G.M| |00003f60| 01 1c 02 7c 94 20 00 00 | 00 00 00 00 09 2a 76 62 |...|. ..|.....*vb| |00003f70| 6c 44 61 74 61 20 00 16 | 00 00 2f 2c 00 f2 00 50 |lData ..|../,...P| |00003f80| 42 14 00 00 07 76 62 6c | 44 61 74 61 00 00 00 0a |B....vbl|Data....| |00003f90| 00 00 32 d2 01 10 00 00 | 00 00 00 00 00 ba 00 07 |..2.....|........| |00003fa0| 00 00 37 9b 00 00 37 aa | 0f 46 72 61 6d 65 53 75 |..7...7.|.FrameSu| |00003fb0| 62 72 6f 75 74 69 6e 65 | 00 00 36 d1 00 00 36 e4 |broutine|..6...6.| |00003fc0| 13 53 69 6d 70 6c 65 56 | 42 4c 53 75 62 72 6f 75 |.SimpleV|BLSubrou| |00003fd0| 74 69 6e 65 00 00 2a 35 | 00 00 2a 3f 0b 56 42 4c |tine..*5|..*?.VBL| |00003fe0| 49 6e 73 74 61 6c 6c 00 | 00 00 35 21 00 00 35 3b |Install.|..5!..5;| |00003ff0| 1b 56 42 4c 49 6e 74 65 | 72 72 75 70 74 53 65 72 |.VBLInte|rruptSer| |00004000| 76 69 63 65 52 6f 75 74 | 69 6e 65 00 00 00 34 0a |viceRout|ine...4.| |00004010| 00 00 34 24 1b 56 42 4c | 49 6e 74 65 72 72 75 70 |..4$.VBL|Interrup| |00004020| 74 53 65 72 76 69 63 65 | 52 6f 75 74 69 6e 65 00 |tService|Routine.| |00004030| 00 00 30 78 00 00 30 81 | 09 56 42 4c 52 65 6d 6f |..0x..0.|.VBLRemo| |00004040| 76 65 00 00 32 a2 00 00 | 32 ae 0d 56 42 4c 52 65 |ve..2...|2..VBLRe| |00004050| 6d 6f 76 65 41 6c 6c 00 | 00 00 00 1e 00 86 00 18 |moveAll.|........| |00004060| 01 89 02 77 00 86 00 18 | 01 89 02 77 00 00 00 00 |...w....|...w....| |00004070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 48 00 09 |........|.....H..| |00004080| 4d 6f 6e 61 63 6f 00 00 | 00 00 00 00 00 00 00 00 |Monaco..|........| |00004090| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000040a0| 00 03 00 04 00 58 00 06 | 02 6c 02 86 00 58 00 06 |.....X..|.l...X..| |000040b0| 02 6c 02 86 ad b6 79 7c | 00 00 36 b0 00 00 36 c6 |.l....y||..6...6.| |000040c0| 00 00 32 ba 00 00 00 00 | 00 04 00 01 00 01 00 00 |..2.....|........| |000040d0| 01 00 00 00 02 ce 00 00 | 01 ce 00 00 00 86 01 6c |........|.......l| |000040e0| f1 68 3a c2 00 00 00 1c | 00 86 00 03 44 54 56 55 |.h:.....|....DTVU| |000040f0| 00 00 00 22 42 4b 50 54 | 00 00 00 2e 4d 50 53 52 |..."BKPT|....MPSR| |00004100| 00 02 00 3a 4d 57 42 42 | 00 00 00 5e 4e 26 ff ff |...:MWBB|...^N&..| |00004110| 00 00 00 00 00 00 00 00 | 5b 2d ff ff 00 00 00 8c |........|[-......| |00004120| 00 00 00 00 03 ef ff ff | 00 00 00 9a 00 00 00 00 |........|........| |00004130| 03 f0 ff ff 00 00 01 58 | 00 00 00 00 03 ed ff ff |.......X|........| |00004140| 00 00 01 7a 00 00 00 00 | 03 f0 ff ff 00 00 01 c6 |...z....|........| |00004150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00004160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00004170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| +--------+-------------------------+-------------------------+--------+--------+